From 1e0cbf2820f72922a6890f144577285d3ed1a41f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 15 Jun 2011 23:18:14 +0200 Subject: [PATCH] Flexbox, Gecko edition. --- 4chan_x.user.js | 22 +++++++++++++++------- script.coffee | 16 +++++++++++----- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 19097a88a..7c2703678 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -954,7 +954,7 @@ return $.replace(home, a); }, dialog: function() { - var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, link, main, obj, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3; + var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, link, main, obj, overlay, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3; hiddenThreads = $.getValue("hiddenThreads/" + g.BOARD + "/", {}); hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length; html = "

"; @@ -1001,10 +1001,14 @@ } $.bind($('textarea[name=flavors]', dialog), 'change', $.cb.value); $.bind($('input[name=time]', dialog), 'keyup', options.cb.time); - $.append(d.body, dialog); + overlay = $.el('div', { + id: 'overlay' + }); + $.append(overlay, dialog); + $.append(d.body, overlay); options.cb.time.call($('input[name=time]', dialog)); - $.bind(dialog, 'click', function() { - return $.rm(dialog); + $.bind(overlay, 'click', function() { + return $.rm(overlay); }); return $.bind(dialog.firstElementChild, 'click', function(e) { return e.stopPropagation(); @@ -2668,12 +2672,17 @@ right: 5px;\ }\ \ - #options {\ + #overlay {\ position: fixed;\ top: 0;\ right: 0;\ bottom: 0;\ left: 0;\ + background: rgba(0,0,0,.5);\ + }\ + #options {\ + height: 100%;\ + width: 100%;\ display: -webkit-box;\ display: -moz-box;\ display: box;\ @@ -2683,9 +2692,8 @@ -webkit-box-pack: center;\ -moz-box-pack: center;\ box-pack: center;\ - background: rgba(0,0,0,.5);\ }\ - #options > div {\ + #options .dialog {\ padding: 5px;\ min-width: 500px;\ }\ diff --git a/script.coffee b/script.coffee index a715bbbef..bc4519372 100644 --- a/script.coffee +++ b/script.coffee @@ -783,11 +783,13 @@ options = $.bind $('textarea[name=flavors]', dialog), 'change', $.cb.value $.bind $('input[name=time]', dialog), 'keyup', options.cb.time - $.append d.body, dialog + overlay = $.el 'div', id: 'overlay' + $.append overlay, dialog + $.append d.body, overlay options.cb.time.call $('input[name=time]', dialog) - $.bind dialog, 'click', -> $.rm dialog + $.bind overlay, 'click', -> $.rm overlay $.bind dialog.firstElementChild, 'click', (e) -> e.stopPropagation() tab: -> @@ -2037,12 +2039,17 @@ main = right: 5px; } - #options { + #overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; + background: rgba(0,0,0,.5); + } + #options { + height: 100%; + width: 100%; display: -webkit-box; display: -moz-box; display: box; @@ -2052,9 +2059,8 @@ main = -webkit-box-pack: center; -moz-box-pack: center; box-pack: center; - background: rgba(0,0,0,.5); } - #options > div { + #options .dialog { padding: 5px; min-width: 500px; }