luci-base: ui.js: mark user-changed widgets
Set a `data-changed=true` attribute on the widget element when the user did any change to the default value. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
53ac685092
commit
4dfa657f77
1 changed files with 5 additions and 0 deletions
|
@ -70,6 +70,11 @@ var UIElement = L.Class.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setChangeEvents: function(targetNode /*, ... */) {
|
setChangeEvents: function(targetNode /*, ... */) {
|
||||||
|
var tag_changed = L.bind(function(ev) { this.setAttribute('data-changed', true) }, this.node);
|
||||||
|
|
||||||
|
for (var i = 1; i < arguments.length; i++)
|
||||||
|
targetNode.addEventListener(arguments[i], tag_changed);
|
||||||
|
|
||||||
this.registerEvents(targetNode, 'widget-change', this.varargs(arguments, 1));
|
this.registerEvents(targetNode, 'widget-change', this.varargs(arguments, 1));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue