Commit b9063c55 authored by Pettersson Tomas's avatar Pettersson Tomas

fixes with setting end point date and refreshing trajectory labels

parent df02cc1f
...@@ -408,9 +408,10 @@ var EXTrajectory = (function (_super) { ...@@ -408,9 +408,10 @@ var EXTrajectory = (function (_super) {
} }
else { else {
var diff = Math.abs(self.from - newdate); var diff = Math.abs(self.from - newdate);
var nrofhours = Math.round(((diff / 1000) / 60) / 60); var nrofhours = ((diff / 1000) / 60) / 60;
if (nrofhours <= 72) { if (nrofhours <= 72) {
self.durationhours = nrofhours; self.durationhours = nrofhours;
self.to = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.refreshTrajectory(); self.refreshTrajectory();
self.fireChangeFn(self); self.fireChangeFn(self);
delete self.durationhours; delete self.durationhours;
...@@ -735,6 +736,7 @@ var EXTrajectory = (function (_super) { ...@@ -735,6 +736,7 @@ var EXTrajectory = (function (_super) {
EXTrajectory.prototype.clear = function () { EXTrajectory.prototype.clear = function () {
var self = this; var self = this;
_super.prototype.clear.call(this); _super.prototype.clear.call(this);
self.drawnfeature = null;
self.trajectoryLabelLayer.clearLayers(); self.trajectoryLabelLayer.clearLayers();
self.trajectoryLayer.clearLayers(); self.trajectoryLayer.clearLayers();
self.trajMarkerArray = []; self.trajMarkerArray = [];
......
This diff is collapsed.
...@@ -476,10 +476,11 @@ class EXTrajectory extends STWkit.AccordionCard { ...@@ -476,10 +476,11 @@ class EXTrajectory extends STWkit.AccordionCard {
STWkit.AccordionCard.warningMsg('End point date outside simulation period', 'End point date cannot be before simulation period start date'); STWkit.AccordionCard.warningMsg('End point date outside simulation period', 'End point date cannot be before simulation period start date');
} else { } else {
var diff = Math.abs(self.from - newdate); var diff = Math.abs(self.from - newdate);
var nrofhours = Math.round(((diff/1000)/60)/60); var nrofhours = ((diff/1000)/60)/60;
if (nrofhours <= 72) { if (nrofhours <= 72) {
self.durationhours = nrofhours; self.durationhours = nrofhours;
self.to = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.refreshTrajectory(); self.refreshTrajectory();
self.fireChangeFn(self); self.fireChangeFn(self);
delete self.durationhours; delete self.durationhours;
...@@ -842,6 +843,7 @@ class EXTrajectory extends STWkit.AccordionCard { ...@@ -842,6 +843,7 @@ class EXTrajectory extends STWkit.AccordionCard {
public clear() { public clear() {
var self = this; var self = this;
super.clear(); super.clear();
self.drawnfeature = null;
self.trajectoryLabelLayer.clearLayers(); self.trajectoryLabelLayer.clearLayers();
self.trajectoryLayer.clearLayers() self.trajectoryLayer.clearLayers()
self.trajMarkerArray = []; self.trajMarkerArray = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment