Skip to content

Commit

Permalink
Added status support to plots
Browse files Browse the repository at this point in the history
  • Loading branch information
akhenry committed Jul 25, 2016
1 parent a4f6f6f commit 1b7fc57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ define(

this.boundsListener = this.boundsListener.bind(this);
this.timeSystemListener = this.timeSystemListener.bind(this);
this.followListener = this.followListener.bind(this);
}

ConductorRepresenter.prototype.boundsListener = function (bounds) {
Expand All @@ -51,7 +52,11 @@ define(
start: bounds.start,
end: bounds.end,
domain: timeSystem.metadata.key
});
}, this.conductor.follow());
};

ConductorRepresenter.prototype.followListener = function () {
this.boundsListener(this.conductor.bounds());
};

// Handle a specific representation of a specific domain object
Expand All @@ -61,6 +66,7 @@ define(

this.conductor.on("bounds", this.boundsListener);
this.conductor.on("timeSystem", this.timeSystemListener);
this.conductor.on("follow", this.followListener)
}
};

Expand Down
2 changes: 1 addition & 1 deletion platform/features/plot/res/templates/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
ng-mousemove="subplot.hover($event)"
mct-drag="subplot.continueDrag($event)"
mct-drag-down="subplot.startDrag($event)"
mct-drag-up="subplot.endDrag($event); plot.update()">
mct-drag-up="subplot.endDrag($event); plot.update();">
</mct-chart>
<!-- TODO: Move into correct position; make part of group; infer from set of actions -->
<div class="l-local-controls gl-plot-local-controls t-plot-display-controls"
Expand Down
7 changes: 7 additions & 0 deletions platform/features/plot/src/PlotController.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ define(
setBasePanZoom(bounds);
requery();
}
self.updateStatus($scope.domainObject, follow);
}

this.modeOptions = new PlotModeOptions([], subPlotFactory);
Expand Down Expand Up @@ -369,6 +370,12 @@ define(
return this.pending;
};

PlotController.prototype.updateStatus = function (domainObject, follow) {
if (domainObject.hasCapability('status')) {
domainObject.getCapability('status').set('timeconductor-unsynced', follow && this.isZoomed());
}
};

return PlotController;
}
);
Expand Down

0 comments on commit 1b7fc57

Please sign in to comment.