+ Dragging a tab now causes it to become the focused tab.

+ Hitting return in a name field no longer causes the focused tab to zoom in
This commit is contained in:
Aza Raskin 2010-05-13 14:11:31 -07:00
parent 6dbe98c096
commit 450fed677c
2 changed files with 14 additions and 3 deletions

View File

@ -973,13 +973,21 @@ var DragInfo = function(element, event) {
DragInfo.prototype = {
// ----------
snap: function(event, ui){
window.console.log( event, ui);
//window.console.log( event, ui);
// Step 1: Find the closest group by edge
// Step 2: Match to the to
},
// ----------
start: function() {
// When a tab drag starts, make it the focused tab.
if( !this.item.isAGroup ){
Page.setActiveTab(this.item);
}
},
// ----------
drag: function(event, ui) {
if(this.item.isAGroup) {
@ -1023,6 +1031,7 @@ DragInfo.prototype = {
this.item.reloadBounds();
this.item.pushAway();
}
}
};
@ -1041,6 +1050,7 @@ window.Groups = {
cancel: '.close',
start: function(e, ui) {
drag.info = new DragInfo(this, e);
drag.info.start();
},
drag: function(e, ui) {
drag.info.drag(e, ui);

View File

@ -197,8 +197,9 @@ window.Page = {
});
$(window).keyup(function(e){
// If you hit escape or return, zoom into the active tab.
if(e.which == 27 || e.which == 13)
// If you hit escape or return, zoom into the active tab,
// but only if a title or other element isn't focused.
if((e.which == 27 || e.which == 13) && $(":focus").length == 0 )
if( self.getActiveTab() ) self.getActiveTab().zoom();
});
},