Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: reload on UI language change or quicktips change, fixes #3377
  • Loading branch information
perexg committed Jan 25, 2016
1 parent f3f66a0 commit 4e913fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions src/webui/static/app/config.js
Expand Up @@ -32,18 +32,25 @@ tvheadend.baseconf = function(panel, index) {
comet: 'config',
labelWidth: 250,
tbar: [wizardButton],
postsave: function(data) {
postsave: function(data, abuttons, form) {
var reload = 0;
var l = data['uilevel'];
if (l >= 0) {
var tr = {0:'basic',1:'advanced',2:'expert'};
l = (l in tr) ? tr[l] : 'basic';
if (l !== tvheadend.uilevel) {
window.location.reload();
return;
}
if (l !== tvheadend.uilevel)
reload = 1;
}
var n = data['uilevel_nochange'] ? true : false;
if (n !== tvheadend.uilevel_nochange)
reload = 1;
var n = data['ui_quicktips'] ? true : false;
if (tvheadend.quicktips !== n)
reload = 1;
var f = form.findField('language_ui');
if (f.initialConfig.value !== data['language_ui'])
reload = 1;
if (reload)
window.location.reload();
},
help: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/webui/static/app/idnode.js
Expand Up @@ -2730,7 +2730,7 @@ tvheadend.idnode_simple = function(panel, conf)
},
success: function() {
if (conf.postsave)
conf.postsave(node, abuttons);
conf.postsave(node, abuttons, current.getForm());
form_load(true);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/webui/static/app/tvheadend.js
Expand Up @@ -442,7 +442,7 @@ function accessUpdate(o) {
if (o.uilevel)
tvheadend.uilevel = o.uilevel;

tvheadend.quicktips = o.quicktips;
tvheadend.quicktips = o.quicktips ? true : false;

if (o.uilevel_nochange)
tvheadend.uilevel_nochange = true;
Expand Down

0 comments on commit 4e913fd

Please sign in to comment.