summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-27 17:52:33 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-27 17:52:33 +0100
commit9f9c4975828f67b8ef2729193bc48399ff0465b3 (patch)
treedadf3cba07e230c51493dfffa6c6d9c360f87351 /module/web/static/js/models
parenttooltips for input elements (diff)
downloadpyload-9f9c4975828f67b8ef2729193bc48399ff0465b3.tar.xz
animations on settings page, highlight modified fields
Diffstat (limited to 'module/web/static/js/models')
-rw-r--r--module/web/static/js/models/ConfigHolder.js10
-rw-r--r--module/web/static/js/models/ConfigItem.js4
2 files changed, 14 insertions, 0 deletions
diff --git a/module/web/static/js/models/ConfigHolder.js b/module/web/static/js/models/ConfigHolder.js
index 8beb31fb8..abd1b9f0a 100644
--- a/module/web/static/js/models/ConfigHolder.js
+++ b/module/web/static/js/models/ConfigHolder.js
@@ -39,6 +39,16 @@ define(['jquery', 'backbone', 'underscore', 'app', './ConfigItem'],
isLoaded: function() {
return this.has('items') || this.has('long_description');
+ },
+
+ // check if any of the items has changes
+ hasChanges: function() {
+ var items = this.get('items');
+ if (!items) return false;
+ return _.reduce(items, function(a, b) {
+ return a || b.isChanged();
+ }, false);
}
+
});
}); \ No newline at end of file
diff --git a/module/web/static/js/models/ConfigItem.js b/module/web/static/js/models/ConfigItem.js
index f55bb2b9e..636c28851 100644
--- a/module/web/static/js/models/ConfigItem.js
+++ b/module/web/static/js/models/ConfigItem.js
@@ -17,6 +17,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
// Model Constructor
initialize: function() {
+ },
+
+ isChanged: function() {
+ return this.get('inputView') && this.get('inputView').getVal() !== this.get('value');
}
});
}); \ No newline at end of file