diff --git a/4chan_x.user.js b/4chan_x.user.js index 662f35413..047bc2aae 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1238,7 +1238,7 @@ } }, dialog: function() { - var arr, back, checked, description, dialog, favicon, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, option, overlay, ta, time, ul, _i, _j, _k, _l, _len, _len2, _len3, _len4, _ref, _ref2, _ref3, _ref4, _ref5; + var arr, back, checked, description, dialog, favicon, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, overlay, ta, time, ul, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4; dialog = ui.dialog('options', '', '\
\
\ @@ -1297,11 +1297,11 @@
Unread Count is disabled.
\ Unread favicons
\ \ \
\ @@ -1373,27 +1373,20 @@ $.on(time, 'keyup', $.cb.value); $.on(time, 'keyup', options.time); favicon = $('select', dialog); - _ref3 = favicon.options; - for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) { - option = _ref3[_j]; - if (option.textContent === conf['favicon']) { - option.selected = true; - break; - } - } + favicon.value = conf['favicon']; $.on(favicon, 'change', $.cb.value); $.on(favicon, 'change', options.favicon); - _ref4 = $$('#keybinds_tab + div input', dialog); - for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) { - input = _ref4[_k]; + _ref3 = $$('#keybinds_tab + div input', dialog); + for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) { + input = _ref3[_j]; input.type = 'text'; input.value = conf[input.name]; $.on(input, 'keydown', options.keybind); } indicators = {}; - _ref5 = $$('.error', dialog); - for (_l = 0, _len4 = _ref5.length; _l < _len4; _l++) { - indicator = _ref5[_l]; + _ref4 = $$('.error', dialog); + for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) { + indicator = _ref4[_k]; key = indicator.firstChild.textContent; indicator.hidden = conf[key]; indicators[key] = indicator; @@ -3045,21 +3038,14 @@ if (!thumb.hidden) return imgExpand.expand(thumb); }, dialog: function() { - var controls, form, imageType, option, select, _i, _len, _ref; + var controls, form, imageType, select; controls = $.el('div', { id: 'imgControls', - innerHTML: " " + innerHTML: "" }); imageType = $.get('imageType', 'full'); select = $('select', controls); - _ref = select.options; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - option = _ref[_i]; - if (option.textContent === imageType) { - option.selected = true; - break; - } - } + select.value = imageType; imgExpand.cb.typeChange.call(select); $.on(select, 'change', $.cb.value); $.on(select, 'change', imgExpand.cb.typeChange); diff --git a/script.coffee b/script.coffee index b33112ad0..5e4591701 100644 --- a/script.coffee +++ b/script.coffee @@ -959,11 +959,11 @@ options =
Unread Count is disabled.
Unread favicons
@@ -1031,10 +1031,7 @@ options = $.on time, 'keyup', $.cb.value $.on time, 'keyup', options.time favicon = $ 'select', dialog - for option in favicon.options - if option.textContent is conf['favicon'] - option.selected = true - break + favicon.value = conf['favicon'] $.on favicon, 'change', $.cb.value $.on favicon, 'change', options.favicon @@ -2360,14 +2357,10 @@ imgExpand = controls = $.el 'div', id: 'imgControls' innerHTML: - " - " + "" imageType = $.get 'imageType', 'full' select = $ 'select', controls - for option in select.options - if option.textContent is imageType - option.selected = true - break + select.value = imageType imgExpand.cb.typeChange.call select $.on select, 'change', $.cb.value $.on select, 'change', imgExpand.cb.typeChange