diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-04-13 22:48:41 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-04-13 22:48:41 +0200 |
commit | 129faaf2b2ad3ac86ae3a9e26a6af2c7537ac673 (patch) | |
tree | 29c6afe6e31d65cd5afc66eadb0f785d9366041c /luci2 | |
parent | c67d90dd163b16f9cc603c898672264ffb17ebf7 (diff) | |
download | luci2-ui-129faaf2b2ad3ac86ae3a9e26a6af2c7537ac673.tar.gz |
luci2: support custom section ordering in L.cbi.TypedSection and L.cbi.TableSection
Diffstat (limited to 'luci2')
-rw-r--r-- | luci2/htdocs/luci2/luci2.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index d275d1b..849a4d4 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -6482,6 +6482,11 @@ function LuCI2() return true; }, + sort: function(section1, section2) + { + return 0; + }, + sections: function(cb) { var s1 = L.uci.sections(this.map.uci_package); @@ -6492,6 +6497,8 @@ function LuCI2() if (this.filter(s1[i])) s2.push(s1[i]); + s2.sort(this.sort); + if (typeof(cb) == 'function') for (var i = 0; i < s2.length; i++) cb.call(this, s2[i]); |