From 802e00b92020b189abd2403efca45ff279f33693 2014-08-04 20:46:01 From: Jonathan Frederic Date: 2014-08-04 20:46:01 Subject: [PATCH] Merge pull request #6226 from jasongrout/css-top-default Remove $el_to_style from the widget javascript code; '' now defaults to this.$el --- diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index 9c54960..8dcda6d 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -463,19 +463,11 @@ define(["widgets/js/manager", _get_selector_element: function (selector) { // Get the elements via the css selector. - - // If the selector is blank, apply the style to the $el_to_style - // element. If the $el_to_style element is not defined, use apply - // the style to the view's element. var elements; if (!selector) { - if (this.$el_to_style === undefined) { - elements = this.$el; - } else { - elements = this.$el_to_style; - } + elements = this.$el; } else { - elements = this.$el.find(selector); + elements = this.$el.find(selector).addBack(selector); } return elements; }, diff --git a/IPython/html/static/widgets/js/widget_bool.js b/IPython/html/static/widgets/js/widget_bool.js index 5a3ba18..83af9d4 100644 --- a/IPython/html/static/widgets/js/widget_bool.js +++ b/IPython/html/static/widgets/js/widget_bool.js @@ -21,7 +21,6 @@ define([ .appendTo(this.$el) .click($.proxy(this.handle_click, this)); - this.$el_to_style = this.$checkbox; // Set default element to style this.update(); // Set defaults. }, diff --git a/IPython/html/static/widgets/js/widget_container.js b/IPython/html/static/widgets/js/widget_container.js index a54fe9b..e568733 100644 --- a/IPython/html/static/widgets/js/widget_container.js +++ b/IPython/html/static/widgets/js/widget_container.js @@ -152,7 +152,6 @@ define([ that.$body.outerHeight(that.$window.innerHeight() - that.$title_bar.outerHeight()); }); - this.$el_to_style = this.$body; this._shown_once = false; this.popped_out = true; @@ -264,7 +263,7 @@ define([ // "modal" - select the modal div // "modal [selector]" - select element(s) within the modal div. // "[selector]" - select elements within $el - // "" - select the $el_to_style + // "" - select the $el if (selector.substring(0, 5) == 'modal') { if (selector == 'modal') { return this.$window; diff --git a/IPython/html/static/widgets/js/widget_int.js b/IPython/html/static/widgets/js/widget_int.js index 2ef71b1..f2e5ce7 100644 --- a/IPython/html/static/widgets/js/widget_int.js +++ b/IPython/html/static/widgets/js/widget_int.js @@ -24,7 +24,6 @@ define([ this.$slider_container = $('
') .addClass('widget-hslider') .append(this.$slider); - this.$el_to_style = this.$slider_container; // Set default element to style this.$el.append(this.$slider_container); this.$readout = $('
') @@ -158,7 +157,6 @@ define([ .addClass('form-control') .addClass('widget-numeric-text') .appendTo(this.$el); - this.$el_to_style = this.$textbox; // Set default element to style this.update(); // Set defaults. }, @@ -262,7 +260,6 @@ define([ .addClass('progress') .addClass('widget-progress') .appendTo(this.$el); - this.$el_to_style = this.$progress; // Set default element to style this.$bar = $('
') .addClass('progress-bar') .css('width', '50%') diff --git a/IPython/html/static/widgets/js/widget_selection.js b/IPython/html/static/widgets/js/widget_selection.js index 901ac99..3922dc9 100644 --- a/IPython/html/static/widgets/js/widget_selection.js +++ b/IPython/html/static/widgets/js/widget_selection.js @@ -21,7 +21,6 @@ define([ .addClass('widget_item') .addClass('btn-group') .appendTo(this.$el); - this.$el_to_style = this.$buttongroup; // Set default element to style this.$droplabel = $('