From d3dd38039856abf6f3301d217c28439e636ff864 Mon Sep 17 00:00:00 2001 From: Dan Andrei Date: Tue, 24 Jun 2014 20:00:59 +0300 Subject: [PATCH] enable all fields on reset --- data.js | 1 + ui/fields.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data.js b/data.js index a092ea0..e916829 100644 --- a/data.js +++ b/data.js @@ -185,6 +185,7 @@ function save (callback) { self.data = data[0]; callback(null, self.data); self.emit('saved', null, self.data, true); + self.emit('dataSet', self.data); return; } diff --git a/ui/fields.js b/ui/fields.js index 8ddd6a6..59ef3d5 100644 --- a/ui/fields.js +++ b/ui/fields.js @@ -42,9 +42,6 @@ function fillForm () { for (var field in fields) { if (!fields.hasOwnProperty(field)) continue; - // enable field - enableField.call(self, field); - for (var i = 0, l = fields[field].value.length; i < l; ++i) { // change value using filters @@ -228,6 +225,9 @@ function reset (formOnly) { for (var field in fields) { if (!fields.hasOwnProperty(field)) continue; + // enable all fields + enableField.call(self, field); + for (var i = 0, l = fields[field].value.length; i < l; ++i) { // textarea inputs if (fields[field].value[i].html) {