Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
feat(layout): add touch event support
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Dec 31, 2013
1 parent 161d88f commit 9198b89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/ui-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,14 @@ angular.module('ui.layout', [])


// Bind the click on the bar then you can move it all over the page.
iElement.bind('mousedown', function (e) {
iElement.on('mousedown touchstart', function (e) {
e.preventDefault();
e.stopPropagation();
htmlElement.bind('mousemove', _resize);
htmlElement.on('mousemove touchmove', _resize);
return false;
});
htmlElement.bind('mouseup', function (e) {
e.preventDefault();
e.stopPropagation();
htmlElement.unbind('mousemove');
return false;
htmlElement.on('mouseup touchend', function () {
htmlElement.off('mousemove touchmove');
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/layout-scenar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* global browserTrigger */

//splitMoveTests('touch', 'touchstart', 'touchmove', 'touchend');
splitMoveTests('touch', 'touchstart', 'touchmove', 'touchend');
splitMoveTests('mouse', 'mousedown', 'mousemove', 'mouseup');

// Wrapper to abstract over using touch events or mouse events.
Expand Down

0 comments on commit 9198b89

Please sign in to comment.