From 52a5d1bd4535a316f788d60d74cd220fe00279e6 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 7 Feb 2015 20:48:00 -0800 Subject: [PATCH] Disable 'Apply CSS' button when Custom CSS is disabled. --- src/General/Settings.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index c1c41311d..0fbb11dd5 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -337,14 +337,16 @@ Settings = interval = $ 'input[name="Interval"]', section customCSS = $ 'input[name="Custom CSS"]', section + applyCSS = $ '#apply-css', section interval.value = Conf['Interval'] customCSS.checked = Conf['Custom CSS'] inputs['usercss'].disabled = !Conf['Custom CSS'] + applyCSS.disabled = !Conf['Custom CSS'] - $.on interval, 'change', ThreadUpdater.cb.interval - $.on customCSS, 'change', Settings.togglecss - $.on $('#apply-css', section), 'click', Settings.usercss + $.on interval, 'change', ThreadUpdater.cb.interval + $.on customCSS, 'change', Settings.togglecss + $.on applyCSS, 'click', Settings.usercss archBoards = {} for {name, boards, files, software, withCredentials} in Redirect.archives @@ -464,7 +466,7 @@ Settings = img[3].src = Favicon.unreadDead togglecss: -> - if $('textarea[name=usercss]', $.x 'ancestor::fieldset[1]', @).disabled = !@checked + if $('textarea[name=usercss]', $.x 'ancestor::fieldset[1]', @).disabled = $.id('apply-css').disabled = !@checked CustomCSS.rmStyle() else CustomCSS.addStyle()