diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 2a87ce760..85ee0f861 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1802,7 +1802,7 @@ }; Menu.prototype.open = function(button, data) { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, prevEntry, right, style, top, _i, _len, _ref, _ref1, _ref2; + var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; menu = this.makeMenu(); currentMenu = menu; @@ -1812,11 +1812,6 @@ entry = _ref[_i]; this.insertEntry(entry, menu, data); } - entry = $('.entry', menu); - while (prevEntry = this.findNextEntry(entry, -1)) { - entry = prevEntry; - } - this.focus(entry); $.on(d, 'click', this.close); $.on(d, 'CloseMenu', this.close); $.add(Header.hover, menu); @@ -1833,6 +1828,8 @@ style.right = "" + right + "px"; style.bottom = "" + bottom + "px"; style.left = "" + left + "px"; + entry = $('.entry', menu); + this.focus(entry); return menu.focus(); }; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index c5af5d6cc..5c94c0e21 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1793,7 +1793,7 @@ }; Menu.prototype.open = function(button, data) { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, prevEntry, right, style, top, _i, _len, _ref, _ref1, _ref2; + var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; menu = this.makeMenu(); currentMenu = menu; @@ -1803,11 +1803,6 @@ entry = _ref[_i]; this.insertEntry(entry, menu, data); } - entry = $('.entry', menu); - while (prevEntry = this.findNextEntry(entry, -1)) { - entry = prevEntry; - } - this.focus(entry); $.on(d, 'click', this.close); $.on(d, 'CloseMenu', this.close); $.add(Header.hover, menu); @@ -1824,6 +1819,8 @@ style.right = "" + right + "px"; style.bottom = "" + bottom + "px"; style.left = "" + left + "px"; + entry = $('.entry', menu); + this.focus(entry); return menu.focus(); }; diff --git a/builds/crx.crx b/builds/crx.crx index 847e07949..0be30c8ec 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 9e2816bd7..95139642f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1716,7 +1716,7 @@ }; Menu.prototype.open = function(button, data) { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, prevEntry, right, style, top, _i, _len, _ref, _ref1, _ref2; + var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; menu = this.makeMenu(); currentMenu = menu; @@ -1726,11 +1726,6 @@ entry = _ref[_i]; this.insertEntry(entry, menu, data); } - entry = $('.entry', menu); - while (prevEntry = this.findNextEntry(entry, -1)) { - entry = prevEntry; - } - this.focus(entry); $.on(d, 'click', this.close); $.on(d, 'CloseMenu', this.close); $.add(Header.hover, menu); @@ -1747,6 +1742,8 @@ style.right = "" + right + "px"; style.bottom = "" + bottom + "px"; style.left = "" + left + "px"; + entry = $('.entry', menu); + this.focus(entry); return menu.focus(); }; diff --git a/src/lib/ui.coffee b/src/lib/ui.coffee index 30354f7b5..f23ab851f 100644 --- a/src/lib/ui.coffee +++ b/src/lib/ui.coffee @@ -58,10 +58,6 @@ UI = do -> for entry in @entries @insertEntry entry, menu, data - entry = $ '.entry', menu - while prevEntry = @findNextEntry entry, -1 - entry = prevEntry - @focus entry $.on d, 'click', @close $.on d, 'CloseMenu', @close $.add Header.hover, menu @@ -87,6 +83,12 @@ UI = do -> style.bottom = "#{bottom}px" style.left = "#{left}px" + entry = $ '.entry', menu + # We've removed flexbox, so we don't user order anymore. + # while prevEntry = @findNextEntry entry, -1 + # entry = prevEntry + @focus entry + menu.focus() insertEntry: (entry, parent, data) ->