From 3ea3600a23b111e0bcdd387bfd3d1dca2d855544 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 9 Jul 2012 16:31:04 +0200 Subject: [PATCH] convert some tabs to spaces --- source/Ox.UI/js/Form/Form.js | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/source/Ox.UI/js/Form/Form.js b/source/Ox.UI/js/Form/Form.js index db301408..3aeea712 100644 --- a/source/Ox.UI/js/Form/Form.js +++ b/source/Ox.UI/js/Form/Form.js @@ -42,42 +42,42 @@ Ox.Form = function(options, self) { self.itemIds[i] = item.options('id') || item.id; self.$items[i] = Ox.FormItem({element: item}).appendTo(that); item.bindEvent({ - autovalidate: function(data) { - validateForm(i, data.valid); - data.valid && self.$items[i].setMessage(''); - }, - /* - // fixme: should't inputs also trigger a change event? - blur: function(data) { - that.triggerEvent('change', { - id: self.itemIds[i], - data: data - }); - }, - */ - change: function(data) { - // fixme: shouldn't this be key/value instead of id/data? - that.triggerEvent('change', { - id: self.itemIds[i], - data: data - }); - validateItem(i, function(valid) { - validateForm(i, valid); - }); - }, - submit: function(data) { - self.formIsValid && that.submit(); - }, - validate: function(data) { - validateForm(i, data.valid); - // 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() { + autovalidate: function(data) { + validateForm(i, data.valid); + data.valid && self.$items[i].setMessage(''); + }, + /* + // fixme: should't inputs also trigger a change event? + blur: function(data) { + that.triggerEvent('change', { + id: self.itemIds[i], + data: data + }); + }, + */ + change: function(data) { + // fixme: shouldn't this be key/value instead of id/data? + that.triggerEvent('change', { + id: self.itemIds[i], + data: data + }); + validateItem(i, function(valid) { + validateForm(i, valid); + }); + }, + submit: function(data) { + self.formIsValid && that.submit(); + }, + validate: function(data) { + validateForm(i, data.valid); + // 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); - } - }); + }, 0); + } + }); }); self.formIsValid = self.options.validate(self.itemIsValid);