From 6168fd52295d5a1035f80c175dee8ae102d3a8f6 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 7 Nov 2016 23:29:22 -0800 Subject: [PATCH] Fix undo removing all filters in Firefox (#946) as well as the filters not being scrolled to the bottom when an item is added from the menu. --- src/Filtering/Filter.coffee | 8 ++++---- src/General/Settings.coffee | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index 47c124f7e..5c98a82fc 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -271,7 +271,7 @@ Filter = select = $ 'select[name=filter]', section select.value = type Settings.selectFilter.call select - ta = $ 'textarea', section - tl = ta.textLength - ta.setSelectionRange tl, tl - ta.focus() + $.onExists section, 'textarea', (ta) -> + tl = ta.textLength + ta.setSelectionRange tl, tl + ta.focus() diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 055a431ab..9032940fe 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -441,10 +441,10 @@ Settings = name: name className: 'field' spellcheck: false - $.get name, Conf[name], (item) -> - (ta.value = item[name]) $.on ta, 'change', $.cb.value - $.add div, ta + $.get name, Conf[name], (item) -> + ta.value = item[name] + $.add div, ta return $.extend div, <%= readHTML('Filter-guide.html') %> $('.warning', div).hidden = Conf['Filter']