diff --git a/4chan_x.user.js b/4chan_x.user.js index bda7278d8..0bde40ee8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1002,6 +1002,9 @@ } $.bind($('textarea[name=flavors]', dialog), 'change', $.cb.value); $.bind($('input[name=time]', dialog), 'keyup', options.cb.time); + $.append(d.body, $.el('div', { + className: 'overlay' + })); $.append(d.body, dialog); options.cb.time.call($('input[name=time]', dialog)); dialog.addEventListener('mousedown', (function(e) { @@ -1011,6 +1014,7 @@ }, rm: function() { $.rm($('#options')); + $.rm($('.overlay')); return window.removeEventListener('mousedown', options.rm, false); }, tab: function() { @@ -2780,6 +2784,14 @@ .inlined {\ opacity: .5;\ }\ + .overlay {\ + position: fixed;\ + width: 100%;\ + height: 100%;\ + top: 0;\ + left: 0;\ + background-color: rgba(0,0,0,.5);\ + }\ ' }; main.init(); diff --git a/script.coffee b/script.coffee index 127527819..4b1f5db91 100644 --- a/script.coffee +++ b/script.coffee @@ -783,7 +783,11 @@ options = $.bind link, 'click', options.tab for link in $$ '#floaty a', dialog $.bind $('textarea[name=flavors]', dialog), 'change', $.cb.value $.bind $('input[name=time]', dialog), 'keyup', options.cb.time + + $.append d.body, $.el 'div', className: 'overlay' + $.append d.body, dialog + options.cb.time.call $('input[name=time]', dialog) dialog.addEventListener 'mousedown', ((e) -> e.stopPropagation()), false @@ -791,6 +795,7 @@ options = rm: -> $.rm $ '#options' + $.rm $ '.overlay' window.removeEventListener 'mousedown', options.rm, false tab: -> @@ -2149,6 +2154,14 @@ main = .inlined { opacity: .5; } + .overlay { + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: rgba(0,0,0,.5); + } ' main.init()