projects
/
project
/
luci2
/
ui.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e93a839
)
luci2: support object comparisations in L.cbi.AbstractValue.changed()
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 13 Apr 2014 20:46:05 +0000
(22:46 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 13 Apr 2014 20:46:05 +0000
(22:46 +0200)
luci2/htdocs/luci2/luci2.js
patch
|
blob
|
history
diff --git
a/luci2/htdocs/luci2/luci2.js
b/luci2/htdocs/luci2/luci2.js
index e47f5bdc9199ac62a7c834a412f9255bd413cb40..d275d1b34bf26d81549e4a1ea005510a5c40c398 100644
(file)
--- a/
luci2/htdocs/luci2/luci2.js
+++ b/
luci2/htdocs/luci2/luci2.js
@@
-5099,7
+5099,7
@@
function LuCI2()
if (typeof(a) != typeof(b))
return true;
- if (
typeof(a) == 'object'
)
+ if (
$.isArray(a)
)
{
if (a.length != b.length)
return true;
@@
-5110,6
+5110,18
@@
function LuCI2()
return false;
}
+ else if ($.isPlainObject(a))
+ {
+ for (var k in a)
+ if (!(k in b))
+ return true;
+
+ for (var k in b)
+ if (!(k in a) || a[k] !== b[k])
+ return true;
+
+ return false;
+ }
return (a != b);
},