You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
860 B
26 lines
860 B
define([ |
|
"dojo/_base/array", |
|
"dojo/aspect", |
|
"dojo/_base/lang", |
|
"dijit/_WidgetBase", |
|
"./_DataBindingMixin" |
|
], function(array, aspect, lang, WidgetBase, DataBindingMixin){ |
|
|
|
//Apply the data binding mixin to all dijits, see mixin class description for details |
|
lang.extend(WidgetBase, /*===== {} || =====*/ new DataBindingMixin()); |
|
|
|
// monkey patch dijit/_WidgetBase.startup to get data binds set up |
|
aspect.before(WidgetBase.prototype, "startup", function(){ |
|
this._dbstartup(); |
|
}); |
|
|
|
// monkey patch dijit/_WidgetBase.destroy to remove watches setup in _DataBindingMixin |
|
aspect.before(WidgetBase.prototype, "destroy", function(){ |
|
if(this._modelWatchHandles){ |
|
array.forEach(this._modelWatchHandles, function(h){ h.unwatch(); }); |
|
} |
|
if(this._viewWatchHandles){ |
|
array.forEach(this._viewWatchHandles, function(h){ h.unwatch(); }); |
|
} |
|
}); |
|
});
|
|
|