mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 09:01:14 +00:00
[Mobile, Gestures] Pinch
Moved MCTPinch directive into plot-reborn. Now emits on pinch action the event to the controller. Edited plot.html to clean up and edited mct-plot.html to include mct-pinch. DrawLoader adjusted to allow and prevent error.
This commit is contained in:
parent
17e2da2d2c
commit
5c3fe78bd5
@ -47,6 +47,11 @@
|
||||
"key": "mctOverlayPlot",
|
||||
"implementation": "directives/MCTOverlayPlot.js",
|
||||
"depends": []
|
||||
},
|
||||
{
|
||||
"key": "mctPinch",
|
||||
"implementation": "directives/MCTPinch.js",
|
||||
"depends": [ "$log", "agentService" ]
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
|
@ -47,13 +47,15 @@
|
||||
<!--TODO: Show/hide using CSS? -->
|
||||
</div>
|
||||
|
||||
<!-- APPLY MCTPinch here-->
|
||||
<mct-chart series="series"
|
||||
viewport="viewport"
|
||||
rectangles="rectangles"
|
||||
ng-mousemove="plot.trackMousePosition($event)"
|
||||
ng-mouseleave="plot.untrackMousePosition()"
|
||||
ng-mousedown="plot.startMarquee()"
|
||||
ng-mouseup="plot.endMarquee()">
|
||||
ng-mouseup="plot.endMarquee()"
|
||||
mct-pinch>
|
||||
</mct-chart>
|
||||
|
||||
<span class="t-wait-spinner loading" ng-show="plot.isRequestPending()">
|
||||
|
@ -5,5 +5,5 @@
|
||||
axes="axes"
|
||||
displayable-range="displayableRange"
|
||||
displayable-domain="displayableDomain">
|
||||
</mct-plot>
|
||||
</mct-plot>
|
||||
</span>
|
||||
|
@ -153,6 +153,10 @@ define(
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function onPinchAction(event) {
|
||||
console.log("TEST");
|
||||
}
|
||||
|
||||
function followDataIfLive() {
|
||||
if (isLive) {
|
||||
@ -163,6 +167,7 @@ define(
|
||||
$scope.$on('series:data:add', followDataIfLive);
|
||||
$scope.$on('user:viewport:change:end', onUserViewportChangeEnd);
|
||||
$scope.$on('user:viewport:change:start', onUserViewportChangeStart);
|
||||
$scope.$on('mct:pinch:action', onPinchAction);
|
||||
|
||||
$scope.$watch('domainObject', linkDomainObject);
|
||||
|
||||
|
@ -28,7 +28,7 @@ define(
|
||||
|
||||
function MCTPinch($log, agentService) {
|
||||
|
||||
function link(scope, element, attrs) {
|
||||
function link($scope, element, attrs) {
|
||||
var posPrev,
|
||||
evePrev;
|
||||
|
||||
@ -44,13 +44,7 @@ define(
|
||||
touchPositionPrev = posPrev || touchPosition,
|
||||
eventPrev = evePrev || event;
|
||||
|
||||
scope.mctPinch({
|
||||
dimensions: touchPosition,
|
||||
prevDimensions: touchPositionPrev,
|
||||
event: event,
|
||||
eventPrev: eventPrev
|
||||
});
|
||||
|
||||
$scope.$emit('mct:pinch:action', event);
|
||||
// Set current position to be previous position
|
||||
// for next touch action
|
||||
posPrev = touchPosition;
|
||||
@ -71,14 +65,11 @@ define(
|
||||
}
|
||||
|
||||
// Stop checking for resize when scope is destroyed
|
||||
// scope.$on("$destroy", destroyEverythingNow);
|
||||
// $scope.$on("$destroy", destroyEverythingNow);
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "A",
|
||||
scope: {
|
||||
mctPinch: "&"
|
||||
},
|
||||
// Link with the provided function
|
||||
link: link
|
||||
};
|
@ -5,7 +5,7 @@ define(
|
||||
'./DrawWebGL',
|
||||
'./Draw2D'
|
||||
],
|
||||
function (DrawWebGL, Draw2D) {
|
||||
function ($log, DrawWebGL, Draw2D) {
|
||||
|
||||
var CHARTS = [
|
||||
DrawWebGL,
|
||||
|
@ -17,16 +17,6 @@
|
||||
"key": "mctChart",
|
||||
"implementation": "MCTChart.js",
|
||||
"depends": [ "$interval", "$log" ]
|
||||
},
|
||||
{
|
||||
"key": "mctPinch",
|
||||
"implementation": "MCTPinch.js",
|
||||
"depends": [ "$log", "agentService" ]
|
||||
},
|
||||
{
|
||||
"key": "mctPan",
|
||||
"implementation": "MCTPan.js",
|
||||
"depends": [ "$log", "agentService" ]
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user