+ Fixed: The tab when dropped into the group is too small and place up and to the right

+ Fixed: On scale-up the tab is sometimes rotated.
+ Fixed: Sometimes on return to TabCandy the tabs are not aligned on the group.
This commit is contained in:
Ian Gilman 2010-05-10 15:27:40 -07:00
parent 3ab382936f
commit f3a93e0c85
3 changed files with 35 additions and 14 deletions

View File

@ -598,9 +598,9 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
child.setZ(zIndex); child.setZ(zIndex);
zIndex--; zIndex--;
child.addClass("stacked");
child.setBounds(box, !animate); child.setBounds(box, !animate);
child.setRotation(self._randRotate(35, index)); child.setRotation(self._randRotate(35, index));
child.addClass("stacked");
} }
}); });
@ -619,16 +619,21 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
}, },
// ---------- // ----------
// Function: childHit
// Called by one of the group's children when the child is clicked on. Returns an object:
// shouldZoom - true if the browser should launch into the tab represented by the child
// callback - called after the zoom animation is complete
childHit: function(child) { childHit: function(child) {
var self = this; var self = this;
// ___ normal click // ___ normal click
if(!this._isStacked || this.expanded) { if(!this._isStacked || this.expanded) {
setTimeout(function() { return {
self.collapse(); shouldZoom: true,
}, 200); callback: function() {
self.collapse();
return false; }
};
} }
// ___ we're stacked, so expand // ___ we're stacked, so expand
@ -698,7 +703,7 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
$shield: $shield $shield: $shield
}; };
return true; return {};
}, },
// ---------- // ----------

View File

@ -98,6 +98,7 @@ window.TabItem.prototype = $.extend(new Item(), {
// a random location (i.e., from [0,0]). Instead, just // a random location (i.e., from [0,0]). Instead, just
// have it appear where it should be. // have it appear where it should be.
if(immediately || (!this._hasBeenDrawn) ) { if(immediately || (!this._hasBeenDrawn) ) {
$container.stop(true, true);
$container.css(css); $container.css(css);
} else { } else {
TabMirror.pausePainting(); TabMirror.pausePainting();
@ -219,9 +220,13 @@ window.TabItems = {
if(e.target.className == "close") { if(e.target.className == "close") {
$(this).find("canvas").data("link").tab.close(); } $(this).find("canvas").data("link").tab.close(); }
else { else {
if(!$(this).data('isDragging')) { if(!$(this).data('isDragging')) {
var item = $(this).data('tabItem'); var item = $(this).data('tabItem');
if(!item.parent || !item.parent.childHit(item)) { var childHitResult = { shouldZoom: true };
if(item.parent)
childHitResult = item.parent.childHit(item);
if(childHitResult.shouldZoom) {
// Zoom in! // Zoom in!
var orig = { var orig = {
width: $(this).width(), width: $(this).width(),
@ -259,9 +264,11 @@ window.TabItems = {
} }
else else
Groups.setActiveGroup( null ); Groups.setActiveGroup( null );
$("body").css("overflow", overflow); $("body").css("overflow", overflow);
if(childHitResult.callback)
childHitResult.callback();
} }
TabMirror.pausePainting(); TabMirror.pausePainting();

View File

@ -191,6 +191,7 @@ window.Page = {
// Zoom out! // Zoom out!
var $tab = $(lastTab.mirror.el); var $tab = $(lastTab.mirror.el);
var rotation = $tab.css("-moz-transform");
var [w,h, pos, z] = [$tab.width(), $tab.height(), $tab.position(), $tab.css("zIndex")]; var [w,h, pos, z] = [$tab.width(), $tab.height(), $tab.position(), $tab.css("zIndex")];
var scale = window.innerWidth / w; var scale = window.innerWidth / w;
@ -204,11 +205,15 @@ window.Page = {
width: window.innerWidth, width: window.innerWidth,
height: h * (window.innerWidth/w), height: h * (window.innerWidth/w),
zIndex: 999999, zIndex: 999999,
'-moz-transform': 'rotate(0deg)'
}).animate({ }).animate({
top: pos.top, left: pos.left, top: pos.top, left: pos.left,
width: w, height: h width: w, height: h
},350, '', function() { },350, '', function() {
$tab.css("zIndex",z); $tab.css({
zIndex: z,
'-moz-transform': rotation
});
$("body").css("overflow", overflow); $("body").css("overflow", overflow);
window.Groups.setActiveGroup(null); window.Groups.setActiveGroup(null);
TabMirror.resumePainting(); TabMirror.resumePainting();
@ -301,6 +306,7 @@ function UIClass(){
this.navBar = Navbar; this.navBar = Navbar;
this.tabBar = Tabbar; this.tabBar = Tabbar;
this.devMode = false; this.devMode = false;
this.focused = true;
var self = this; var self = this;
@ -324,10 +330,13 @@ function UIClass(){
Tabs.onFocus(function() { Tabs.onFocus(function() {
try{ try{
if(this.contentWindow.location.host == "tabcandy") if(this.contentWindow.location.host == "tabcandy") {
self.focused = true;
self.navBar.hide(); self.navBar.hide();
else } else {
self.focused = false;
self.navBar.show(); self.navBar.show();
}
}catch(e){ }catch(e){
Utils.log() Utils.log()
} }