Fix syncing of mute/volume settings between tabs.
This commit is contained in:
parent
36c5f87994
commit
63e0398f51
@ -1,9 +1,18 @@
|
|||||||
Volume =
|
Volume =
|
||||||
init: ->
|
init: ->
|
||||||
return unless g.BOARD.ID in ['gif', 'wsg'] and
|
return unless g.VIEW in ['index', 'thread'] and
|
||||||
g.VIEW in ['index', 'thread'] and
|
|
||||||
(Conf['Image Expansion'] or Conf['Image Hover'] or Conf['Gallery'])
|
(Conf['Image Expansion'] or Conf['Image Hover'] or Conf['Gallery'])
|
||||||
|
|
||||||
|
$.sync 'Allow Sound', (x) ->
|
||||||
|
Conf['Allow Sound'] = x
|
||||||
|
Volume.inputs?.unmute.checked = x
|
||||||
|
|
||||||
|
$.sync 'Default Volume', (x) ->
|
||||||
|
Conf['Default Volume'] = x
|
||||||
|
Volume.inputs?.volume.value = x
|
||||||
|
|
||||||
|
return unless g.BOARD.ID in ['gif', 'wsg']
|
||||||
|
|
||||||
unmuteEntry = UI.checkbox 'Allow Sound', ' Allow Sound'
|
unmuteEntry = UI.checkbox 'Allow Sound', ' Allow Sound'
|
||||||
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]
|
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]
|
||||||
|
|
||||||
@ -19,9 +28,6 @@ Volume =
|
|||||||
$.on @inputs.unmute, 'change', $.cb.checked
|
$.on @inputs.unmute, 'change', $.cb.checked
|
||||||
$.on @inputs.volume, 'change', $.cb.value
|
$.on @inputs.volume, 'change', $.cb.value
|
||||||
|
|
||||||
$.sync 'Allow Sound', (x) -> Volume.inputs.unmute.checked = x
|
|
||||||
$.sync 'Default Volume', (x) -> Volume.inputs.volume.value = x
|
|
||||||
|
|
||||||
Header.menu.addEntry {el: unmuteEntry, order: 200}
|
Header.menu.addEntry {el: unmuteEntry, order: 200}
|
||||||
Header.menu.addEntry {el: volumeEntry, order: 201}
|
Header.menu.addEntry {el: volumeEntry, order: 201}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user