+ Groups now keep the concept of which group is "active"

+ When you open a new tab in an active group, that new tab belongs to the active group.
+ Made the New Tabs area much smaller.
This commit is contained in:
Aza Raskin 2010-04-28 16:39:15 -07:00
parent 600f65520e
commit 6b138766fa
3 changed files with 32 additions and 11 deletions

View File

@ -861,8 +861,9 @@ window.Groups = {
var pad = 5;
var sw = window.innerWidth;
var sh = window.innerHeight;
var w = sw - (pad * 2);
var h = TabItems.tabHeight;
//var w = sw - (pad * 2);
var w = TabItems.tabWidth*2.5 + pad*4;
var h = TabItems.tabHeight*1.2 + pad*2;
return new Rect(pad, sh - (h + pad), w, h);
},
@ -937,11 +938,29 @@ window.Groups = {
// ----------
newTab: function(tabItem) {
var group = this.getNewTabGroup();
//var group = this.getActiveGroup() ? this.getActiveGroup() : this.getNewTabGroup();
var group = this.getActiveGroup();
if( group == null )
group = this.getNewTabGroup();
var $el = $(tabItem.container);
if(group)
group.add($el);
},
// ----------
getActiveGroup: function() {
return this._activeGroup;
},
// ----------
setActiveGroup: function(group) {
try{
this._activeGroup = group;
UI.tabBar.showOnlyTheseTabs( group._children );
}catch(e){Utils.log(e)}
}
};
// ----------

View File

@ -66,7 +66,7 @@ window.TabItem.prototype = $.extend(new Item(), {
var extra = this._getSizeExtra();
var css = {};
const minFontSize = 6;
const minFontSize = 8;
const maxFontSize = 15;
if(rect.left != this.bounds.left)
@ -182,7 +182,7 @@ window.TabItems = {
// ----------
init: function() {
var self = this;
function mod($div){
if(window.Groups) {
$div.data('isDragging', false);
@ -207,7 +207,7 @@ window.TabItems = {
if(!$(this).data('isDragging')) {
var item = $(this).data('tabItem');
if(!item.parent || !item.parent.childHit(item)) {
// ZOOM!
// Zoom in!
var orig = {
width: $(this).width(),
height: $(this).height(),
@ -233,13 +233,13 @@ window.TabItems = {
height:orig.height,
})
.removeClass("front");
Navbar.show();
Navbar.show();
try{
var gID = self.getItemByTab(this).parent.id;
if(gID) {
var group = Groups.group(gID);
UI.tabBar.showOnlyTheseTabs( group._children );
Groups.setActiveGroup( group );
}
}
catch(e){
@ -281,7 +281,7 @@ window.TabItems = {
if(!reconnected && $div.length == 1 && Groups)
Groups.newTab($div.data('tabItem'));
// TODO: Figure out this really weird bug?
// Why is that:
// $div.find("canvas").data("link").tab.url

View File

@ -130,6 +130,7 @@ window.Page = {
Toolbar.unread = 0;
// If there was a lastTab we want to animate
// its mirror for the zoom out.
// Zoom out!
var $tab = $(lastTab.mirror.el);
var [w,h, pos, z] = [$tab.width(), $tab.height(), $tab.position(), $tab.css("zIndex")];
@ -148,9 +149,10 @@ window.Page = {
}).animate({
top: pos.top, left: pos.left,
width: w, height: h
},250, '', function() {
},350, '', function() {
$tab.css("zIndex",z);
$("body").css("overflow", overflow);
window.Groups.setActiveGroup(null);
TabMirror.resumePainting();
});
}