Fix overflow reset when closing the options with the keybind. Fix typo.

This commit is contained in:
Nicolas Stepien 2012-02-07 17:45:57 +01:00
parent c5b06c7d9c
commit 302fd10815
2 changed files with 14 additions and 11 deletions

View File

@ -890,7 +890,7 @@
break; break;
case conf.close: case conf.close:
if (o = $.id('overlay')) { if (o = $.id('overlay')) {
$.rm(o); options.close.call(o);
} else if (qr.el) { } else if (qr.el) {
qr.close(); qr.close();
} }
@ -2043,7 +2043,7 @@
<input type=radio name=tab hidden id=keybinds_tab>\ <input type=radio name=tab hidden id=keybinds_tab>\
<div>\ <div>\
<div class=warning><code>Keybinds</code> are disabled.</div>\ <div class=warning><code>Keybinds</code> are disabled.</div>\
<div>Allowed keys: Ctrl, Alt, a-z, A-Z, 0-1, Up, Down, Right, Left.</div>\ <div>Allowed keys: Ctrl, Alt, a-z, A-Z, 0-9, Up, Down, Right, Left.</div>\
<table><tbody>\ <table><tbody>\
<tr><th>Actions</th><th>Keybinds</th></tr>\ <tr><th>Actions</th><th>Keybinds</th></tr>\
</tbody></table>\ </tbody></table>\
@ -2116,10 +2116,7 @@
overlay = $.el('div', { overlay = $.el('div', {
id: 'overlay' id: 'overlay'
}); });
$.on(overlay, 'click', function() { $.on(overlay, 'click', options.close);
d.body.style.removeProperty('overflow');
return $.rm(overlay);
});
$.on(dialog, 'click', function(e) { $.on(dialog, 'click', function(e) {
return e.stopPropagation(); return e.stopPropagation();
}); });
@ -2130,6 +2127,10 @@
options.time.call(time); options.time.call(time);
return options.favicon.call(favicon); return options.favicon.call(favicon);
}, },
close: function() {
$.rm(this);
return d.body.style.removeProperty('overflow');
},
clearHidden: function() { clearHidden: function() {
$["delete"]("hiddenReplies/" + g.BOARD + "/"); $["delete"]("hiddenReplies/" + g.BOARD + "/");
$["delete"]("hiddenThreads/" + g.BOARD + "/"); $["delete"]("hiddenThreads/" + g.BOARD + "/");

View File

@ -658,7 +658,7 @@ keybinds =
options.dialog() unless $.id 'overlay' options.dialog() unless $.id 'overlay'
when conf.close when conf.close
if o = $.id 'overlay' if o = $.id 'overlay'
$.rm o options.close.call o
else if qr.el else if qr.el
qr.close() qr.close()
when conf.spoiler when conf.spoiler
@ -1597,7 +1597,7 @@ options =
<input type=radio name=tab hidden id=keybinds_tab> <input type=radio name=tab hidden id=keybinds_tab>
<div> <div>
<div class=warning><code>Keybinds</code> are disabled.</div> <div class=warning><code>Keybinds</code> are disabled.</div>
<div>Allowed keys: Ctrl, Alt, a-z, A-Z, 0-1, Up, Down, Right, Left.</div> <div>Allowed keys: Ctrl, Alt, a-z, A-Z, 0-9, Up, Down, Right, Left.</div>
<table><tbody> <table><tbody>
<tr><th>Actions</th><th>Keybinds</th></tr> <tr><th>Actions</th><th>Keybinds</th></tr>
</tbody></table> </tbody></table>
@ -1660,9 +1660,7 @@ options =
indicators[@name].hidden = @checked indicators[@name].hidden = @checked
overlay = $.el 'div', id: 'overlay' overlay = $.el 'div', id: 'overlay'
$.on overlay, 'click', -> $.on overlay, 'click', options.close
d.body.style.removeProperty 'overflow'
$.rm overlay
$.on dialog, 'click', (e) -> e.stopPropagation() $.on dialog, 'click', (e) -> e.stopPropagation()
$.add overlay, dialog $.add overlay, dialog
$.add d.body, overlay $.add d.body, overlay
@ -1672,6 +1670,10 @@ options =
options.time.call time options.time.call time
options.favicon.call favicon options.favicon.call favicon
close: ->
$.rm this
d.body.style.removeProperty 'overflow'
clearHidden: -> clearHidden: ->
#'hidden' might be misleading; it's the number of IDs we're *looking* for, #'hidden' might be misleading; it's the number of IDs we're *looking* for,
# not the number of posts actually hidden on the page. # not the number of posts actually hidden on the page.