mirror of
https://github.com/Carve/qbittorrent-webui-cjratliff.com.git
synced 2025-02-28 15:40:28 +01:00
fixed 'is null' possibility in context menus, fixed dbl click among other things
This commit is contained in:
parent
df8c16acc8
commit
d2b3900f3e
@ -282,23 +282,31 @@ window.qBittorrent.ContextMenu = (function () {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setItemChecked: function (item, checked) {
|
setItemChecked: function (item, checked) {
|
||||||
this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity =
|
if (this.menu.getElement('a[href$=' + item + ']')) {
|
||||||
checked ? '1' : '0'
|
this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity =
|
||||||
|
checked ? '1' : '0'
|
||||||
|
}
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemChecked: function (item) {
|
getItemChecked: function (item) {
|
||||||
return (
|
if (this.menu.getElement('a[href$=' + item + ']')) {
|
||||||
'0' !=
|
return (
|
||||||
this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity
|
'0' !=
|
||||||
)
|
this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return '0'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//hide an item
|
//hide an item
|
||||||
hideItem: function (item) {
|
hideItem: function (item) {
|
||||||
this.menu
|
if (this.menu.getElement('a[href$=' + item + ']')) {
|
||||||
.getElement('a[href$=' + item + ']')
|
this.menu
|
||||||
.parentNode.addClass('invisible')
|
.getElement('a[href$=' + item + ']')
|
||||||
|
.parentNode.addClass('invisible')
|
||||||
|
}
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user