Menu Focus and such.

This commit is contained in:
Zixaphir 2013-04-22 14:42:33 -07:00
parent 9cfc3cad05
commit b6dcaa7ac4
5 changed files with 15 additions and 22 deletions

View File

@ -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();
};

View File

@ -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();
};

Binary file not shown.

View File

@ -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();
};

View File

@ -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) ->