Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: Reset uilevel back to default when reactivated (simple panel)
  • Loading branch information
perexg committed Dec 2, 2015
1 parent e83a4ad commit da15d97
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/webui/static/app/idnode.js
Expand Up @@ -2583,7 +2583,9 @@ tvheadend.idnode_simple = function(panel, conf)
}
}

abuttons.uilevel = tvheadend.idnode_uilevel_menu(uilevel, function (l, refresh) {
function uilevel_change(l, refresh) {
if (l === uilevel)
return;
uilevel = l;
if (!refresh)
return;
Expand All @@ -2600,7 +2602,9 @@ tvheadend.idnode_simple = function(panel, conf)
mpanel.doLayout();
}
}
});
}

abuttons.uilevel = tvheadend.idnode_uilevel_menu(uilevel, uilevel_change);
buttons.push('->');
buttons.push(abuttons.uilevel);

Expand Down Expand Up @@ -2634,7 +2638,7 @@ tvheadend.idnode_simple = function(panel, conf)
});
}

var mpanel = new Ext.Panel({
mpanel = new Ext.Panel({
tbar: buttons,
layout: 'hbox',
padding: 5,
Expand All @@ -2647,6 +2651,10 @@ tvheadend.idnode_simple = function(panel, conf)
dpanel.add(mpanel);
dpanel.doLayout(false, true);

mpanel.on('uilevel', function() {
uilevel_change(tvheadend.uilevel, 1);
});

if (conf.comet) {
update_cb = form_load;
tvheadend.comet.on(conf.comet, update);
Expand All @@ -2663,6 +2671,7 @@ tvheadend.idnode_simple = function(panel, conf)
tvheadend.comet.un(conf.comet, update);
}
dpanel.removeAll(true);
mpanel.purgeListeners();
mpanel = null;
if (conf.destroyer)
conf.destroyer(conf);
Expand All @@ -2676,6 +2685,10 @@ tvheadend.idnode_simple = function(panel, conf)
iconCls: conf.iconCls || ''
});

dpanel.on('show', function() {
if (mpanel)
mpanel.fireEvent('uilevel');
});
tvheadend.paneladd(panel, dpanel, conf.tabIndex);
tvheadend.panelreg(panel, dpanel, builder, destroyer);
};

0 comments on commit da15d97

Please sign in to comment.