Created
June 3, 2010 16:18
-
-
Save paulitex/424084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initMixin: function() { | |
var resizeF; | |
var thisView = this; | |
if (typeof window.onresize === "function"){ | |
resizeF = function(){ | |
window.onresize(); | |
thisView.checkBounds(); | |
}; | |
} | |
else { | |
resizeF = function(){ | |
thisView.checkBounds(); | |
}; | |
} | |
window.onresize = resizeF; | |
}, | |
checkBounds: function() { | |
// recompute bounds, so don't get abandoned off screen | |
var rect = this.computeFrameWithParentFrame(null); | |
// handle X direction | |
this.adjust('left', this._checkX(rect.x, (rect.width/2))); | |
// // handle Y direction | |
this.adjust('top', this._checkY(rect.y, (rect.height/2))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment