Skip to content

Commit

Permalink
Fixed WidgetModality's initialization logic to always run.
Browse files Browse the repository at this point in the history
If a widget was not constructed with `{modal: true}`, WidgetModality's
initialization logic would not run, which is wrong, and it is now fixed.

Also, the initialization logic has moved from the constructor function
to the `initializer` method.

Fixes #2531401
  • Loading branch information
ericf committed Nov 10, 2011
1 parent 6d4eb1e commit 73a4612
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/widget-modality/js/Widget-Modality.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,7 @@ var WIDGET = 'widget',
* @class WidgetModality
* @param {Object} config User configuration object
*/
function WidgetModal(config) {
if (config && config.modal) {
Y.after(this._renderUIModal, this, RENDER_UI);
Y.after(this._syncUIModal, this, SYNC_UI);
Y.after(this._bindUIModal, this, BIND_UI);

if (this.get('rendered')) {
this._renderUIModal();
this._syncUIModal();
this._bindUIModal();
}
}
}
function WidgetModal(config) {}

var MODAL = 'modal',
MASK = 'mask',
Expand Down Expand Up @@ -197,6 +185,16 @@ var WIDGET = 'widget',

WidgetModal.prototype = {

initializer: function () {
Y.after(this._renderUIModal, this, RENDER_UI);
Y.after(this._syncUIModal, this, SYNC_UI);
Y.after(this._bindUIModal, this, BIND_UI);
},

destructor: function () {
this._detachUIHandlesModal();
},

// *** Instance Members *** //

_maskNode : WidgetModal._GET_MASK(),
Expand Down

0 comments on commit 73a4612

Please sign in to comment.