X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=luci2%2Fhtdocs%2Fluci2%2Fluci2.js;h=6a41e269973c85e12883ff97fa5b0c79b3e249df;hb=7dc42e1f9fd2ecff97be4beeb8345e195eb6e74b;hp=291af572d31119ec0e318aa03a68220b420ff3bd;hpb=8f89e46fcaec5cb1deb9e73b9f77b3b1cd0d8ad1;p=project%2Fluci2%2Fui.git diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index 291af57..6a41e26 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -214,7 +214,7 @@ function LuCI2() _class.prototype = prototype; _class.prototype.constructor = _class; - _class.extend = arguments.callee; + _class.extend = Class.extend; return _class; }; @@ -364,8 +364,10 @@ function LuCI2() h += keys[i] + ':' + data[keys[i]]; } - if (h) + if (h.length) location.hash = '#' + h; + else + location.hash = ''; }; this.getHash = function(key) @@ -451,7 +453,7 @@ function LuCI2() if (typeof(ret) != 'undefined' && key != '') ret = ret[key]; - if (type.call(ret) != type.call(req.expect[key])) + if (typeof(ret) == 'undefined' || type.call(ret) != type.call(req.expect[key])) ret = req.expect[key]; break; @@ -1653,29 +1655,22 @@ function LuCI2() var state = _luci2.ui._loading || (_luci2.ui._loading = { modal: $('
') - .addClass('cbi-modal-loader') - .append($('
').text(_luci2.tr('Loading data...'))) + .addClass('modal fade') + .append($('
') + .addClass('modal-dialog') + .append($('
') + .addClass('modal-content luci2-modal-loader') + .append($('
') + .addClass('modal-body') + .text(_luci2.tr('Loading data…'))))) .appendTo(body) + .modal({ + backdrop: 'static', + keyboard: false + }) }); - if (enable) - { - body.css('overflow', 'hidden'); - body.css('padding', 0); - body.css('width', win.width()); - body.css('height', win.height()); - state.modal.css('width', win.width()); - state.modal.css('height', win.height()); - state.modal.show(); - } - else - { - state.modal.hide(); - body.css('overflow', ''); - body.css('padding', ''); - body.css('width', ''); - body.css('height', ''); - } + state.modal.modal(enable ? 'show' : 'hide'); }, dialog: function(title, content, options) @@ -1685,26 +1680,23 @@ function LuCI2() var state = _luci2.ui._dialog || (_luci2.ui._dialog = { dialog: $('
') - .addClass('cbi-modal-dialog') + .addClass('modal fade') .append($('
') + .addClass('modal-dialog') .append($('
') - .addClass('cbi-modal-dialog-header')) - .append($('
') - .addClass('cbi-modal-dialog-body')) - .append($('
') - .addClass('cbi-modal-dialog-footer') - .append($('