Show More
@@ -243,9 +243,21 b' function(widget_manager, underscore, backbone){' | |||
|
243 | 243 | initialize: function (options) { |
|
244 | 244 | // TODO: make changes more granular (e.g., trigger on visible:change) |
|
245 | 245 | this.model.on('change', this.update, this); |
|
246 | this.model.on('msg:custom', this.on_msg, this); | |
|
246 | 247 | BaseWidgetView.prototype.initialize.apply(this, arguments); |
|
247 | 248 | }, |
|
248 | 249 | |
|
250 | on_msg: function(msg) { | |
|
251 | switch(msg.msg_type) { | |
|
252 | case 'add_class': | |
|
253 | this.add_class(msg.selector, msg.class_list); | |
|
254 | break; | |
|
255 | case 'remove_class': | |
|
256 | this.remove_class(msg.selector, msg.class_list); | |
|
257 | break; | |
|
258 | } | |
|
259 | }, | |
|
260 | ||
|
249 | 261 | add_class: function (selector, class_list) { |
|
250 | 262 | var elements = this._get_selector_element(selector); |
|
251 | 263 | if (elements.length > 0) { |
@@ -267,7 +279,7 b' function(widget_manager, underscore, backbone){' | |||
|
267 | 279 | var visible = this.model.get('visible'); |
|
268 | 280 | setTimeout(function() {e.toggle(visible)},0); |
|
269 | 281 | |
|
270 | var css = this.model.css; | |
|
282 | var css = this.model.get('_css'); | |
|
271 | 283 | if (css === undefined) {return;} |
|
272 | 284 | for (var selector in css) { |
|
273 | 285 | if (css.hasOwnProperty(selector)) { |
General Comments 0
You need to be logged in to leave comments.
Login now