mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUAC-901: Do not use scope - parse attributes directly (https://docs.angularjs.org/error/$compile/multidir?p0=guacTouchDrag&p1=guacTouchPinch&p2=new%2Fisolated%20scope&p3=undefined).
This commit is contained in:
@@ -27,7 +27,8 @@ angular.module('touch').directive('guacTouchDrag', [function guacTouchDrag() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
scope: {
|
|
||||||
|
link: function linkGuacTouchDrag($scope, $element, $attrs) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called during a drag gesture as the user's finger is placed upon
|
* Called during a drag gesture as the user's finger is placed upon
|
||||||
@@ -64,11 +65,7 @@ angular.module('touch').directive('guacTouchDrag', [function guacTouchDrag() {
|
|||||||
* false if the default action of the touch event should be
|
* false if the default action of the touch event should be
|
||||||
* prevented, any other value otherwise.
|
* prevented, any other value otherwise.
|
||||||
*/
|
*/
|
||||||
guacTouchDrag : '='
|
var guacTouchDrag = $scope.$eval($attrs.guacTouchDrag);
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
link: function guacTouchDrag($scope, $element) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The element which will register the drag gesture.
|
* The element which will register the drag gesture.
|
||||||
@@ -154,9 +151,9 @@ angular.module('touch').directive('guacTouchDrag', [function guacTouchDrag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Signal start/change in drag gesture
|
// Signal start/change in drag gesture
|
||||||
if (inProgress && $scope.guacTouchDrag) {
|
if (inProgress && guacTouchDrag) {
|
||||||
$scope.$apply(function dragChanged() {
|
$scope.$apply(function dragChanged() {
|
||||||
if ($scope.guacTouchDrag(true, startX, startY, currentX, currentY, deltaX, deltaY) === false)
|
if (guacTouchDrag(true, startX, startY, currentX, currentY, deltaX, deltaY) === false)
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -172,9 +169,9 @@ angular.module('touch').directive('guacTouchDrag', [function guacTouchDrag() {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
// Signal end of drag gesture
|
// Signal end of drag gesture
|
||||||
if (inProgress && $scope.guacTouchDrag) {
|
if (inProgress && guacTouchDrag) {
|
||||||
$scope.$apply(function dragComplete() {
|
$scope.$apply(function dragComplete() {
|
||||||
if ($scope.guacTouchDrag(true, startX, startY, currentX, currentY, deltaX, deltaY === false))
|
if (guacTouchDrag(true, startX, startY, currentX, currentY, deltaX, deltaY === false))
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user