show header buttons conditionally
This commit is contained in:
parent
9f702f5d14
commit
13215960c4
@ -125,6 +125,11 @@
|
|||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#openwebrx-main-buttons .button[data-toggle-panel] {
|
||||||
|
/* will be enabled by javascript if the panel is present in the DOM */
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#openwebrx-main-buttons .button img {
|
#openwebrx-main-buttons .button img {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
function Header(el) {
|
function Header(el) {
|
||||||
this.el = el;
|
this.el = el;
|
||||||
|
|
||||||
this.el.find('#openwebrx-main-buttons').find('[data-toggle-panel]').click(function () {
|
var $buttons = this.el.find('#openwebrx-main-buttons').find('[data-toggle-panel]').filter(function(){
|
||||||
|
// ignore buttons when the corresponding panel is not in the DOM
|
||||||
|
return $('#' + $(this).data('toggle-panel'))[0];
|
||||||
|
});
|
||||||
|
|
||||||
|
$buttons.css({display: 'block'}).click(function () {
|
||||||
toggle_panel($(this).data('toggle-panel'));
|
toggle_panel($(this).data('toggle-panel'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user