mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
+ 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:
parent
ebe90d195a
commit
a3c5f6f2b8
@ -598,9 +598,9 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
|
||||
child.setZ(zIndex);
|
||||
zIndex--;
|
||||
|
||||
child.addClass("stacked");
|
||||
child.setBounds(box, !animate);
|
||||
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) {
|
||||
var self = this;
|
||||
|
||||
// ___ normal click
|
||||
if(!this._isStacked || this.expanded) {
|
||||
setTimeout(function() {
|
||||
self.collapse();
|
||||
}, 200);
|
||||
|
||||
return false;
|
||||
return {
|
||||
shouldZoom: true,
|
||||
callback: function() {
|
||||
self.collapse();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ___ we're stacked, so expand
|
||||
@ -698,7 +703,7 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
|
||||
$shield: $shield
|
||||
};
|
||||
|
||||
return true;
|
||||
return {};
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -98,6 +98,7 @@ window.TabItem.prototype = $.extend(new Item(), {
|
||||
// a random location (i.e., from [0,0]). Instead, just
|
||||
// have it appear where it should be.
|
||||
if(immediately || (!this._hasBeenDrawn) ) {
|
||||
$container.stop(true, true);
|
||||
$container.css(css);
|
||||
} else {
|
||||
TabMirror.pausePainting();
|
||||
@ -219,9 +220,13 @@ window.TabItems = {
|
||||
if(e.target.className == "close") {
|
||||
$(this).find("canvas").data("link").tab.close(); }
|
||||
else {
|
||||
if(!$(this).data('isDragging')) {
|
||||
if(!$(this).data('isDragging')) {
|
||||
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!
|
||||
var orig = {
|
||||
width: $(this).width(),
|
||||
@ -259,9 +264,11 @@ window.TabItems = {
|
||||
}
|
||||
else
|
||||
Groups.setActiveGroup( null );
|
||||
|
||||
|
||||
$("body").css("overflow", overflow);
|
||||
$("body").css("overflow", overflow);
|
||||
|
||||
if(childHitResult.callback)
|
||||
childHitResult.callback();
|
||||
}
|
||||
|
||||
TabMirror.pausePainting();
|
||||
|
@ -191,6 +191,7 @@ window.Page = {
|
||||
// Zoom out!
|
||||
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 scale = window.innerWidth / w;
|
||||
|
||||
@ -204,11 +205,15 @@ window.Page = {
|
||||
width: window.innerWidth,
|
||||
height: h * (window.innerWidth/w),
|
||||
zIndex: 999999,
|
||||
'-moz-transform': 'rotate(0deg)'
|
||||
}).animate({
|
||||
top: pos.top, left: pos.left,
|
||||
width: w, height: h
|
||||
},350, '', function() {
|
||||
$tab.css("zIndex",z);
|
||||
$tab.css({
|
||||
zIndex: z,
|
||||
'-moz-transform': rotation
|
||||
});
|
||||
$("body").css("overflow", overflow);
|
||||
window.Groups.setActiveGroup(null);
|
||||
TabMirror.resumePainting();
|
||||
@ -301,6 +306,7 @@ function UIClass(){
|
||||
this.navBar = Navbar;
|
||||
this.tabBar = Tabbar;
|
||||
this.devMode = false;
|
||||
this.focused = true;
|
||||
|
||||
var self = this;
|
||||
|
||||
@ -324,10 +330,13 @@ function UIClass(){
|
||||
|
||||
Tabs.onFocus(function() {
|
||||
try{
|
||||
if(this.contentWindow.location.host == "tabcandy")
|
||||
if(this.contentWindow.location.host == "tabcandy") {
|
||||
self.focused = true;
|
||||
self.navBar.hide();
|
||||
else
|
||||
} else {
|
||||
self.focused = false;
|
||||
self.navBar.show();
|
||||
}
|
||||
}catch(e){
|
||||
Utils.log()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user