+ Working on edge-cases for keyboarding around TabCandy

+ Works better with stacks (but not all the way, yet)
This commit is contained in:
Aza Raskin 2010-05-12 20:31:51 -07:00
parent cc60577ba9
commit 9498388fdd
2 changed files with 14 additions and 3 deletions

View File

@ -120,7 +120,7 @@ window.TabItem.prototype = $.extend(new Item(), {
}).dequeue();
}
if(css.fontSize && !$container.hasClass("stacked")) {
if(css.fontSize && !this.inStack()) {
if(css.fontSize < minFontSize )
$title.fadeOut().dequeue();
else
@ -144,6 +144,11 @@ window.TabItem.prototype = $.extend(new Item(), {
Utils.trace('TabItem.setBounds: this.bounds is not a real rectangle!', this.bounds);
},
// ----------
inStack: function(){
return $(this.container).hasClass("stacked");
},
// ----------
setZ: function(value) {
$(this.container).css({zIndex: value});

View File

@ -164,7 +164,8 @@ window.Page = {
.sort(function(a,b){
return myCenter.distance(a[0]) - myCenter.distance(b[0]);
});
return matches[0][1];
if( matches.length > 0 ) return matches[0][1];
else return null;
}
var norm = null;
@ -185,7 +186,12 @@ window.Page = {
if( norm != null ){
var nextTab = getClosestTabBy(norm);
self.setActiveTab(nextTab);
if( nextTab ){
if( nextTab.inStack() && !nextTab.parent.expanded){
nextTab = nextTab.parent.getChild(0);
}
self.setActiveTab(nextTab);
}
e.preventDefault();
}
});