diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-01-31 21:37:22 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-01-31 21:37:22 +0000 |
commit | 3c884108e834be975aacee8d2e5c0607cc3c92e7 (patch) | |
tree | ee649bf8ace17fbdb9398887b474f1e08edf4b2a | |
parent | e2e4f3caad043cbf1a7b3a53d923cd804a83d276 (diff) | |
download | luci2-ui-3c884108e834be975aacee8d2e5c0607cc3c92e7.tar.gz |
luci2: change LuCI2.ui.dialog() to return the resulting element tree, implement wide option
-rw-r--r-- | luci2/htdocs/luci2/luci2.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index bbfb6d3..8d250cd 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -3268,13 +3268,13 @@ function LuCI2() { state.dialog.modal('hide'); - return; + return state.dialog; } var cnt = state.dialog.children().children().children('div.modal-body'); var ftr = state.dialog.children().children().children('div.modal-footer'); - ftr.empty(); + ftr.empty().show(); if (options.style == 'confirm') { @@ -3295,10 +3295,21 @@ function LuCI2() .attr('disabled', true)); } + if (options.wide) + { + state.dialog.addClass('wide'); + } + else + { + state.dialog.removeClass('wide'); + } + state.dialog.find('h4:first').text(title); state.dialog.modal('show'); cnt.empty().append(content); + + return state.dialog; }, upload: function(title, content, options) |