mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 02:58:13 -05:00
Update QuickSwitch context menu whenever it changes. Fix #1225.
This commit is contained in:
parent
8663ee9a68
commit
e432687831
@ -277,14 +277,12 @@ class ChromeOptions extends OmegaTarget.Options
|
|||||||
})
|
})
|
||||||
|
|
||||||
_quickSwitchInit: false
|
_quickSwitchInit: false
|
||||||
_quickSwitchContextMenuCreated: false
|
_quickSwitchHandlerReady: false
|
||||||
_quickSwitchCanEnable: false
|
_quickSwitchCanEnable: false
|
||||||
setQuickSwitch: (quickSwitch, canEnable) ->
|
setQuickSwitch: (quickSwitch, canEnable) ->
|
||||||
@_quickSwitchCanEnable = canEnable
|
@_quickSwitchCanEnable = canEnable
|
||||||
if not @_quickSwitchContextMenuCreated
|
if not @_quickSwitchHandlerReady
|
||||||
@_quickSwitchContextMenuCreated = true
|
@_quickSwitchHandlerReady = true
|
||||||
if quickSwitch
|
|
||||||
chrome.contextMenus?.update('enableQuickSwitch', {checked: true})
|
|
||||||
window.OmegaContextMenuQuickSwitchHandler = (info) =>
|
window.OmegaContextMenuQuickSwitchHandler = (info) =>
|
||||||
changes = {}
|
changes = {}
|
||||||
changes['-enableQuickSwitch'] = info.checked
|
changes['-enableQuickSwitch'] = info.checked
|
||||||
@ -319,6 +317,8 @@ class ChromeOptions extends OmegaTarget.Options
|
|||||||
chrome.tabs.reload(tab.id)
|
chrome.tabs.reload(tab.id)
|
||||||
else
|
else
|
||||||
chrome.browserAction.setPopup({popup: 'popup/index.html'})
|
chrome.browserAction.setPopup({popup: 'popup/index.html'})
|
||||||
|
|
||||||
|
chrome.contextMenus?.update('enableQuickSwitch', {checked: !!quickSwitch})
|
||||||
Promise.resolve()
|
Promise.resolve()
|
||||||
|
|
||||||
setInspect: (settings) ->
|
setInspect: (settings) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user