Created
January 29, 2011 22:44
-
-
Save funkatron/802288 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
var resizeHandle = document.getElementById('resize-se'); | |
resizeHandle.addEventListener('mousedown', function (e){ | |
var isDragging = true; | |
var mousePosition = {x:event.clientX, y:event.clientY}; | |
document.addEventListener('mousemove', drag, false); | |
document.addEventListener('mouseup', function (e){ | |
document.removeEventListener('mousemove', drag, false); | |
document.removeEventListener('mouseup', arguments.callee, false); | |
}, false); | |
function drag(event) { | |
// console.log("firing drag", event.clientX, event.clientY); | |
var wnd = Titanium.UI.currentWindow; | |
wnd.setBounds({'x':wnd.getX(), 'y':wnd.getY(), 'width':event.clientX, 'height':event.clientY}); | |
Spaz.Windows.onWindowResize(); | |
return; | |
} | |
event.stopPropagation(); | |
}, false); |
I do find it laggy (see my comment on the issue in lighthouse). Really hoping they can patch it up somehow to work better. I don't know of a better approach though.
Well your code its virtually the same as mine, so i think this is the best solution for now. Cheers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you find this is laggy? All my experiments show updating the window size is slow