Tiny cleanup of previous cleanup. Use the 'change' event instead of 'input' for the interval input.
This commit is contained in:
parent
748d811dde
commit
80046be0b2
@ -2824,7 +2824,7 @@
|
|||||||
|
|
||||||
Updater = {
|
Updater = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var checkbox, checked, dialog, html, input, name, title, type, _i, _len, _ref;
|
var checkbox, checked, dialog, html, input, name, title, _i, _len, _ref;
|
||||||
html = '<div class=move><span id=count></span> <span id=timer></span></div>';
|
html = '<div class=move><span id=count></span> <span id=timer></span></div>';
|
||||||
checkbox = Config.updater.checkbox;
|
checkbox = Config.updater.checkbox;
|
||||||
for (name in checkbox) {
|
for (name in checkbox) {
|
||||||
@ -2843,11 +2843,10 @@
|
|||||||
_ref = $$('input', dialog);
|
_ref = $$('input', dialog);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
input = _ref[_i];
|
input = _ref[_i];
|
||||||
type = input.type, name = input.name;
|
if (input.type === 'checkbox') {
|
||||||
if (type === 'checkbox') {
|
|
||||||
$.on(input, 'click', $.cb.checked);
|
$.on(input, 'click', $.cb.checked);
|
||||||
}
|
}
|
||||||
switch (name) {
|
switch (input.name) {
|
||||||
case 'Scroll BG':
|
case 'Scroll BG':
|
||||||
$.on(input, 'click', this.cb.scrollBG);
|
$.on(input, 'click', this.cb.scrollBG);
|
||||||
this.cb.scrollBG.call(input);
|
this.cb.scrollBG.call(input);
|
||||||
@ -2859,11 +2858,10 @@
|
|||||||
case 'Auto Update This':
|
case 'Auto Update This':
|
||||||
$.on(input, 'click', this.cb.autoUpdate);
|
$.on(input, 'click', this.cb.autoUpdate);
|
||||||
this.cb.autoUpdate.call(input);
|
this.cb.autoUpdate.call(input);
|
||||||
Conf[input.name] = input.checked;
|
|
||||||
break;
|
break;
|
||||||
case 'Interval':
|
case 'Interval':
|
||||||
input.value = Conf['Interval'];
|
input.value = Conf['Interval'];
|
||||||
$.on(input, 'input', this.cb.interval);
|
$.on(input, 'change', this.cb.interval);
|
||||||
this.cb.interval.call(input);
|
this.cb.interval.call(input);
|
||||||
break;
|
break;
|
||||||
case 'Update Now':
|
case 'Update Now':
|
||||||
@ -2913,7 +2911,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
autoUpdate: function() {
|
autoUpdate: function() {
|
||||||
if (this.checked) {
|
if (Conf['Auto Update This'] = this.checked) {
|
||||||
return Updater.timeoutID = setTimeout(Updater.timeout, 1000);
|
return Updater.timeoutID = setTimeout(Updater.timeout, 1000);
|
||||||
} else {
|
} else {
|
||||||
return clearTimeout(Updater.timeoutID);
|
return clearTimeout(Updater.timeoutID);
|
||||||
|
|||||||
@ -2277,10 +2277,9 @@ Updater =
|
|||||||
@lastModified = '0'
|
@lastModified = '0'
|
||||||
|
|
||||||
for input in $$ 'input', dialog
|
for input in $$ 'input', dialog
|
||||||
{type, name} = input
|
if input.type is 'checkbox'
|
||||||
if type is 'checkbox'
|
|
||||||
$.on input, 'click', $.cb.checked
|
$.on input, 'click', $.cb.checked
|
||||||
switch name
|
switch input.name
|
||||||
when 'Scroll BG'
|
when 'Scroll BG'
|
||||||
$.on input, 'click', @cb.scrollBG
|
$.on input, 'click', @cb.scrollBG
|
||||||
@cb.scrollBG.call input
|
@cb.scrollBG.call input
|
||||||
@ -2290,11 +2289,9 @@ Updater =
|
|||||||
when 'Auto Update This'
|
when 'Auto Update This'
|
||||||
$.on input, 'click', @cb.autoUpdate
|
$.on input, 'click', @cb.autoUpdate
|
||||||
@cb.autoUpdate.call input
|
@cb.autoUpdate.call input
|
||||||
# Required for the QR's update after posting.
|
|
||||||
Conf[input.name] = input.checked
|
|
||||||
when 'Interval'
|
when 'Interval'
|
||||||
input.value = Conf['Interval']
|
input.value = Conf['Interval']
|
||||||
$.on input, 'input', @cb.interval
|
$.on input, 'change', @cb.interval
|
||||||
@cb.interval.call input
|
@cb.interval.call input
|
||||||
when 'Update Now'
|
when 'Update Now'
|
||||||
$.on input, 'click', @update
|
$.on input, 'click', @update
|
||||||
@ -2331,7 +2328,7 @@ Updater =
|
|||||||
textContent: 'Thread Updater'
|
textContent: 'Thread Updater'
|
||||||
Updater.timer.hidden = true
|
Updater.timer.hidden = true
|
||||||
autoUpdate: ->
|
autoUpdate: ->
|
||||||
if @checked
|
if Conf['Auto Update This'] = @checked
|
||||||
Updater.timeoutID = setTimeout Updater.timeout, 1000
|
Updater.timeoutID = setTimeout Updater.timeout, 1000
|
||||||
else
|
else
|
||||||
clearTimeout Updater.timeoutID
|
clearTimeout Updater.timeoutID
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user