diff --git a/4chan_x.user.js b/4chan_x.user.js index addf1df39..298d38b48 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -962,7 +962,7 @@ } }, dialog: function() { - var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, link, main, obj, overlay, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3; + var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, link, main, obj, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3; hiddenThreads = $.getValue("hiddenThreads/" + g.BOARD + "/", {}); hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length; html = "
main | sauce | time
support throd | github | uso | donate

"; @@ -1009,17 +1009,12 @@ } $.bind($('textarea[name=flavors]', dialog), 'change', $.cb.value); $.bind($('input[name=time]', dialog), 'keyup', options.cb.time); - overlay = $.el('div', { - className: 'overlay' - }); - $.append(d.body, overlay); $.append(d.body, dialog); options.cb.time.call($('input[name=time]', dialog)); - return $.bind(overlay, 'click', options.rm); - }, - rm: function() { - $.rm($('#options')); - return $.rm($('.overlay')); + $.bind(dialog, 'click', options.toggle); + return $.bind(dialog.firstElementChild, 'click', function(e) { + return e.stopPropagation(); + }); }, tab: function() { var content, div, _i, _len, _results; @@ -2694,6 +2689,7 @@ -webkit-box-pack: center;\ -moz-box-pack: center;\ box-pack: center;\ + background: rgba(0,0,0,.5);\ }\ #options > div {\ padding: 5px;\ @@ -2717,14 +2713,6 @@ overflow: auto;\ height: 400px;\ }\ - .overlay {\ - position: fixed;\ - width: 100%;\ - height: 100%;\ - top: 0;\ - left: 0;\ - background-color: rgba(0,0,0,.5);\ - }\ \ #qr {\ position: fixed;\ diff --git a/script.coffee b/script.coffee index bccb1b3aa..ecc766594 100644 --- a/script.coffee +++ b/script.coffee @@ -789,18 +789,12 @@ options = $.bind $('textarea[name=flavors]', dialog), 'change', $.cb.value $.bind $('input[name=time]', dialog), 'keyup', options.cb.time - overlay = $.el 'div', className: 'overlay' - $.append d.body, overlay - $.append d.body, dialog options.cb.time.call $('input[name=time]', dialog) - $.bind overlay, 'click', options.rm - - rm: -> - $.rm $ '#options' - $.rm $ '.overlay' + $.bind dialog, 'click', options.toggle + $.bind dialog.firstElementChild, 'click', (e) -> e.stopPropagation() tab: -> content = $$ '#main, #flavors, #time' @@ -2064,6 +2058,7 @@ main = -webkit-box-pack: center; -moz-box-pack: center; box-pack: center; + background: rgba(0,0,0,.5); } #options > div { padding: 5px; @@ -2087,14 +2082,6 @@ main = overflow: auto; height: 400px; } - .overlay { - position: fixed; - width: 100%; - height: 100%; - top: 0; - left: 0; - background-color: rgba(0,0,0,.5); - } #qr { position: fixed;