angular-ui-layout
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "angular-ui-layout", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "This directive allows you to split !", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -831,19 +831,26 @@ 'use strict'; | ||
element.on('mousedown touchstart', function(e) { | ||
ctrl.movingSplitbar = scope.splitbar; | ||
ctrl.processSplitbar(scope.splitbar); | ||
if (e.button === 0 || e.type === 'touchstart') { | ||
// only trigger when left mouse button is pressed: | ||
ctrl.movingSplitbar = scope.splitbar; | ||
ctrl.processSplitbar(scope.splitbar); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
htmlElement.on('mousemove touchmove', function(event) { | ||
scope.$apply(angular.bind(ctrl, ctrl.mouseMoveHandler, event)); | ||
}); | ||
return false; | ||
htmlElement.on('mousemove touchmove', handleMouseMove); | ||
return false; | ||
} | ||
}); | ||
htmlElement.on('mouseup touchend', function(event) { | ||
function handleMouseMove(event) { | ||
scope.$apply(angular.bind(ctrl, ctrl.mouseMoveHandler, event)); | ||
} | ||
function handleMouseUp(event) { | ||
scope.$apply(angular.bind(ctrl, ctrl.mouseUpHandler, event)); | ||
htmlElement.off('mousemove touchmove'); | ||
}); | ||
htmlElement.off('mousemove touchmove', handleMouseMove); | ||
} | ||
htmlElement.on('mouseup touchend', handleMouseUp); | ||
scope.$watch('splitbar.size', function(newValue) { | ||
@@ -857,6 +864,2 @@ element.css(ctrl.sizeProperties.sizeProperty, newValue + 'px'); | ||
scope.$on('$destroy', function() { | ||
htmlElement.off('mouseup touchend mousemove touchmove'); | ||
}); | ||
//Add splitbar to layout container list | ||
@@ -867,2 +870,4 @@ ctrl.addContainer(scope.splitbar); | ||
ctrl.removeContainer(scope.splitbar); | ||
htmlElement.off('mouseup touchend', handleMouseUp); | ||
htmlElement.off('mousemove touchmove', handleMouseMove); | ||
scope.$evalAsync(); | ||
@@ -869,0 +874,0 @@ }); |
136430
2273