From: Jaroslav Kysela Date: Wed, 2 Dec 2015 17:29:30 +0000 (+0100) Subject: WEBUI: refresh page when the global view level or persistent level settings is changed X-Git-Tag: v4.2.1~1406 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4aeabd25d353c924e2c30136069973f997b9ec30;p=thirdparty%2Ftvheadend.git WEBUI: refresh page when the global view level or persistent level settings is changed - sometimes, the simplest solutions are best --- diff --git a/src/webui/static/app/config.js b/src/webui/static/app/config.js index 38a89a47f..2710ef3ef 100644 --- a/src/webui/static/app/config.js +++ b/src/webui/static/app/config.js @@ -16,9 +16,14 @@ tvheadend.baseconf = function(panel, index) { if (l >= 0) { var tr = {0:'basic',1:'advanced',2:'expert'}; l = (l in tr) ? tr[l] : 'basic'; - tvheadend.change_uilevel(l); - abuttons.uilevel.initialConfig.tvh_uilevel_set(l); + if (l !== tvheadend.uilevel) { + window.location.reload(); + return; + } } + var n = data['uilevel_nochange'] ? true : false; + if (n !== tvheadend.uilevel_nochange) + window.location.reload(); }, help: function() { new tvheadend.help(_('General Configuration'), 'config_general.html'); diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 84d1655bf..14d164647 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -1316,24 +1316,6 @@ tvheadend.idnode_panel = function(conf, panel, dpanel, builder, destroyer) tvheadend.paneladd(panel, dpanel, conf.tabIndex); tvheadend.panelreg(panel, dpanel, builder, destroyer); } - - if (conf.uilevel) { - var f = function(l) { - var d = panel.findById(dpanel.id); - if (!tvheadend.uilevel_match(conf.uilevel, l)) { - if (d) { - panel.remove(dpanel); - destroyer(); - } - } else { - if (!d) { - tvheadend.paneladd(panel, dpanel, conf.tabIndex); - tvheadend.panelreg(panel, dpanel, builder, destroyer); - } - } - } - tvheadend.uilevel_cb.push(f); - } } /* diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 1b9d8551c..3a22c39ef 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -5,7 +5,6 @@ tvheadend.admin = false; tvheadend.dialog = null; tvheadend.uilevel = 'expert'; tvheadend.uilevel_nochange = false; -tvheadend.uilevel_cb = []; tvheadend.cookieProvider = new Ext.state.CookieProvider({ // 7 days from now @@ -45,14 +44,6 @@ tvheadend.uilevel_match = function(target, current) { return true; } -tvheadend.change_uilevel = function(uilevel) { - if (tvheadend.uilevel !== uilevel) { - tvheadend.uilevel = uilevel; - for (var i = 0; i < tvheadend.uilevel_cb.length; i++) - tvheadend.uilevel_cb[i](uilevel); - } -} - /** * Displays a help popup window */ @@ -430,6 +421,9 @@ function accessUpdate(o) { tvheadend.admin = o.admin == true; + if (o.uilevel) + tvheadend.uilevel = o.uilevel; + if (o.uilevel_nochange) tvheadend.uilevel_nochange = true; @@ -577,9 +571,6 @@ function accessUpdate(o) { tvheadend.uilevel = ''; } - if (o.uilevel) - tvheadend.change_uilevel(o.uilevel); - if (o.admin == true && tvheadend.statuspanel == null) { tvheadend.statuspanel = new tvheadend.status; tvheadend.rootTabPanel.add(tvheadend.statuspanel);