12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- define("dojox/mvc/_patches", [
- "dojo/_base/lang",
- "dojo/_base/array",
- "dijit/_WidgetBase",
- "./_DataBindingMixin",
- "dijit/form/ValidationTextBox",
- "dijit/form/NumberTextBox"
- ], function(lang, array, wb, dbm, vtb, ntb){
-
-
- lang.extend(wb, new dbm());
-
- var oldWidgetBaseStartup = wb.prototype.startup;
- wb.prototype.startup = function(){
- this._dbstartup();
- oldWidgetBaseStartup.apply(this);
- };
-
- var oldWidgetBaseDestroy = wb.prototype.destroy;
- wb.prototype.destroy = function(/*Boolean*/ preserveDom){
- if(this._modelWatchHandles){
- array.forEach(this._modelWatchHandles, function(h){ h.unwatch(); });
- }
- if(this._viewWatchHandles){
- array.forEach(this._viewWatchHandles, function(h){ h.unwatch(); });
- }
- oldWidgetBaseDestroy.apply(this, [preserveDom]);
- };
-
- var oldValidationTextBoxIsValid = vtb.prototype.isValid;
- vtb.prototype.isValid = function(/*Boolean*/ isFocused){
- return (this.inherited("isValid", arguments) !== false && oldValidationTextBoxIsValid.apply(this, [isFocused]));
- };
-
- var oldNumberTextBoxIsValid = ntb.prototype.isValid;
- ntb.prototype.isValid = function(/*Boolean*/ isFocused){
- return (this.inherited("isValid", arguments) !== false && oldNumberTextBoxIsValid.apply(this, [isFocused]));
- };
- });
|