Skip to content

Commit

Permalink
Fixes #156. Bug in selectize.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit committed Dec 20, 2013
1 parent bf140bb commit 13257f4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion stylebot/background/browseraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var BrowserAction = {
port.onDisconnect.addListener(function() {
if (activeTab) {
chrome.tabs.sendRequest(activeTab.id, {
name: "resetPreview"
name: 'resetPreview'
}, function(response){});
}
});
Expand Down
8 changes: 5 additions & 3 deletions stylebot/editor/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,11 @@ stylebot.style = {
* @param {String} css The CSS to apply to the page.
*/
resetPreview: function() {
CSSUtils.crunchCSS(this.rules, true, true, _.bind(function(css) {
this.cache.$style.html(css);
}, this));
if (this.rules && this.cache.$style) {
CSSUtils.crunchCSS(this.rules, true, true, _.bind(function(css) {
this.cache.$style.html(css);
}, this));
};

this.hidePreviewPopover();
},
Expand Down
3 changes: 2 additions & 1 deletion stylebot/editor/widget-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var WidgetUI = {
SIZE_UNITS: ['px', 'em', '%', 'pt'],
DEFAULT_SIZE_UNIT: 'px',

DEFAULT_FONT_STACK: ['Helvetica',
DEFAULT_FONT_STACK: [
'Helvetica',
'Roboto',
'Lato',
'Palatino',
Expand Down
4 changes: 2 additions & 2 deletions stylebot/editor/widget.basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ stylebot.widget.basic = {
}]
},
{
name: '<u>C</u>olor & Background',
name: '<u>C</u>olor &amp; Background',
controls: [{
name: 'Color',
id: 'color',
Expand Down Expand Up @@ -134,7 +134,7 @@ stylebot.widget.basic = {
}]
},
{
name: '<u>L</u>ayout & Visibility',
name: '<u>L</u>ayout &amp; Visibility',
controls: [{
name: 'Visibility',
id: 'display',
Expand Down
2 changes: 1 addition & 1 deletion stylebot/libs/colorpicker/colorpicker.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion stylebot/libs/selectize/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@

$wrapper = $('<div>').addClass(this.settings.theme).addClass(this.settings.wrapperClass);
$control = $('<div>').addClass(this.settings.inputClass).addClass('items').toggleClass('has-options', !$.isEmptyObject(this.options)).appendTo($wrapper);
$control_input = $('<input type="text">').appendTo($control);
$control_input = $('<input type="text" />').appendTo($control);
$dropdown = $('<div>').addClass(this.settings.dropdownClass).hide().appendTo($wrapper);

displayMode = this.$input.css('display');
Expand Down

0 comments on commit 13257f4

Please sign in to comment.