This commit is contained in:
Ian Gilman 2010-04-28 17:18:24 -07:00
commit 7fcdbe0da5
3 changed files with 32 additions and 11 deletions

View File

@ -895,8 +895,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);
},
@ -971,11 +972,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)
@ -181,7 +181,7 @@ window.TabItems = {
// ----------
init: function() {
var self = this;
function mod($div){
if(window.Groups) {
$div.data('isDragging', false);
@ -206,7 +206,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(),
@ -232,13 +232,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){
@ -280,7 +280,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();
});
}