mirror of
https://github.com/nasa/openmct.git
synced 2025-05-20 17:33:33 +00:00
[Mobile] Comments
Added comments to destroy and remaining MCTPinch functions.
This commit is contained in:
parent
9d1841db55
commit
0b7ab75512
@ -51,7 +51,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculates the midpoint between two given
|
// Calculates the midpoint between two given
|
||||||
// coordinates
|
// coordinates and returns it as coordinate object
|
||||||
function calculateMidpoint(coordOne, coordTwo) {
|
function calculateMidpoint(coordOne, coordTwo) {
|
||||||
return {
|
return {
|
||||||
clientX: (coordOne.clientX + coordTwo.clientX) / 2,
|
clientX: (coordOne.clientX + coordTwo.clientX) / 2,
|
||||||
@ -211,17 +211,29 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Stop checking for touch when scope is destroyed
|
// Stop checking for touch when scope is destroyed
|
||||||
|
// (when user navigates away from graph).
|
||||||
$scope.$on("$destroy", function () {
|
$scope.$on("$destroy", function () {
|
||||||
|
|
||||||
|
// All elements' event listeners are
|
||||||
|
// removed
|
||||||
element.off('touchstart', touchStart);
|
element.off('touchstart', touchStart);
|
||||||
element.off('touchmove', touchChange);
|
element.off('touchmove', touchChange);
|
||||||
element.off('touchend', touchEnd);
|
element.off('touchend', touchEnd);
|
||||||
element.off('touchcancel', touchEnd);
|
element.off('touchcancel', touchEnd);
|
||||||
|
|
||||||
|
// If for some reason, midtouch the
|
||||||
|
// user is navigated away, set pan/pinch
|
||||||
|
// statuses to false
|
||||||
|
isPan = false;
|
||||||
|
isPinch = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
// MCTPinch is treated as an attribute
|
||||||
restrict: "A",
|
restrict: "A",
|
||||||
// Link with the provided function
|
|
||||||
|
// Link with the provided function above
|
||||||
link: link
|
link: link
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user