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;
case conf.close:
if (o = $.id('overlay')) {
$.rm(o);
options.close.call(o);
} else if (qr.el) {
qr.close();
}
@ -2043,7 +2043,7 @@
<input type=radio name=tab hidden id=keybinds_tab>\
<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>\
<tr><th>Actions</th><th>Keybinds</th></tr>\
</tbody></table>\
@ -2116,10 +2116,7 @@
overlay = $.el('div', {
id: 'overlay'
});
$.on(overlay, 'click', function() {
d.body.style.removeProperty('overflow');
return $.rm(overlay);
});
$.on(overlay, 'click', options.close);
$.on(dialog, 'click', function(e) {
return e.stopPropagation();
});
@ -2130,6 +2127,10 @@
options.time.call(time);
return options.favicon.call(favicon);
},
close: function() {
$.rm(this);
return d.body.style.removeProperty('overflow');
},
clearHidden: function() {
$["delete"]("hiddenReplies/" + g.BOARD + "/");
$["delete"]("hiddenThreads/" + g.BOARD + "/");

View File

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