From 63e0398f517beed6431e66a8ec50dd14fa06be6a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 1 Feb 2015 11:46:21 -0800 Subject: [PATCH] Fix syncing of mute/volume settings between tabs. --- src/Images/Volume.coffee | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Images/Volume.coffee b/src/Images/Volume.coffee index e818dc5f4..079d4bb54 100644 --- a/src/Images/Volume.coffee +++ b/src/Images/Volume.coffee @@ -1,9 +1,18 @@ Volume = init: -> - return unless g.BOARD.ID in ['gif', 'wsg'] and - g.VIEW in ['index', 'thread'] and + return unless g.VIEW in ['index', 'thread'] and (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.title = Config.main['Images and Videos']['Allow Sound'][1] @@ -19,9 +28,6 @@ Volume = $.on @inputs.unmute, 'change', $.cb.checked $.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: volumeEntry, order: 201}