Skip to content

Instantly share code, notes, and snippets.

@funkatron
Created January 29, 2011 22:44
Show Gist options
  • Select an option

  • Save funkatron/802288 to your computer and use it in GitHub Desktop.

Select an option

Save funkatron/802288 to your computer and use it in GitHub Desktop.
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);
@bytespider

Copy link
Copy Markdown

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