diff --git a/source/Ox.UI/js/Form/Ox.Form.js b/source/Ox.UI/js/Form/Ox.Form.js index ab5925c8..191d2abe 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -75,7 +75,12 @@ Ox.Form = function(options, self) { }, validate: function(data) { validate(i, data.valid); - self.$items[i].setMessage(data.valid ? '' : data.message); + // timeout needed for cases where the form is removed + // from the DOM, triggering blur of an empty item - + // in this case, we don't want the message to appear + setTimeout(function() { + self.$items[i].setMessage(data.valid ? '' : data.message); + }, 0); } }); }); diff --git a/source/Ox.UI/js/Window/Ox.Dialog.js b/source/Ox.UI/js/Window/Ox.Dialog.js index a106d0ae..164aca1a 100644 --- a/source/Ox.UI/js/Window/Ox.Dialog.js +++ b/source/Ox.UI/js/Window/Ox.Dialog.js @@ -688,11 +688,23 @@ Ox.Dialog = function(options, self) { return that; }; + that.disableButtons = function() { + self.options.buttons.forEach(function(button) { + !Ox.isEmpty(button) && button.options({disabled: true}); + }); + }; + that.enableButton = function(id) { getButtonById(id).options({disabled: false}); return that; }; + that.enableButtons = function() { + self.options.buttons.forEach(function(button) { + !Ox.isEmpty(button) && button.options({disabled: false}); + }); + }; + that.open = function() { self.initialHeight = self.options.height; self.initialWidth = self.options.width; @@ -723,6 +735,7 @@ Ox.Dialog = function(options, self) { } } }); + that.triggerEvent('open'); return that; };