ORIGINAL: Added the reverse zoom animation (for when switching back to tabcandy).

TODO: How do we get a prettier original image to zoom? How do you force a redraw?
This commit is contained in:
aza@More-Better-Internet.local 2010-03-19 16:10:43 -07:00
parent a863dfd0ea
commit 191cec0c2a

View File

@ -93,9 +93,27 @@ var Page = {
return false;
});
Utils.ilog(Tabs.onFocus)
Tabs.onFocus(function(tab){
Utils.log("HHHIIII")
var lastTab = null;
Tabs.onFocus(function(){
// If we switched to TabCandy window...
if( this.contentWindow == window && lastTab != null){
// If there was a lastTab we want to animate
// its mirror for the zoom out.
var $tab = $(lastTab.mirror.el);
var [w,h, pos] = [$tab.width(), $tab.height(), $tab.position()];
$tab.css({
top: 0, left: 0,
width: window.innerWidth,
height: h * (window.innerWidth/w),
zIndex: 999999,
})
.animate({
top: pos.top, left: pos.left,
width: w, height: h
},250);
}
lastTab = this;
});
$("#tabbar").toggle(