Commit 4e871785 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

made validate on location public

parent 68b327ec
...@@ -156,14 +156,6 @@ var STWkit; ...@@ -156,14 +156,6 @@ var STWkit;
self.circleButton.onclick = function () { self.geometryType = "circle"; self.control.setType(self.geometryType); }; self.circleButton.onclick = function () { self.geometryType = "circle"; self.control.setType(self.geometryType); };
self.polygonButton.disabled = false; self.polygonButton.disabled = false;
self.hasPosition = false; self.hasPosition = false;
function validate() {
if (!self.hasPosition)
return;
self.status = true;
AccordionCard.enableNext(self.nextButton, true);
(self.oncallback && self.oncallback());
}
;
var positionLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm); var positionLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm);
var positionlabelDiv = L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid); var positionlabelDiv = L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
_super.prototype.addLabelDiv.call(_this, positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#oil-oo-position' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#oil-oo-position' target='_blank'>here</a>");
...@@ -253,7 +245,7 @@ var STWkit; ...@@ -253,7 +245,7 @@ var STWkit;
} }
self.control.showTable(); self.control.showTable();
self.hasPosition = true; self.hasPosition = true;
validate(); self.validate();
} }
} }
}); });
...@@ -333,6 +325,14 @@ var STWkit; ...@@ -333,6 +325,14 @@ var STWkit;
LocationCard.prototype.show = function () { LocationCard.prototype.show = function () {
_super.prototype.show.call(this); _super.prototype.show.call(this);
}; };
LocationCard.prototype.validate = function () {
if (!this.hasPosition)
return;
this.status = true;
AccordionCard.enableNext(this.nextButton, true);
(this.oncallback && this.oncallback());
};
;
LocationCard.prototype.hide = function () { LocationCard.prototype.hide = function () {
_super.prototype.hide.call(this); _super.prototype.hide.call(this);
}; };
......
This diff is collapsed.
...@@ -178,12 +178,7 @@ module STWkit { ...@@ -178,12 +178,7 @@ module STWkit {
self.polygonButton.disabled = false; self.polygonButton.disabled = false;
self.hasPosition = false; self.hasPosition = false;
function validate() {
if (!self.hasPosition) return;
self.status = true;
AccordionCard.enableNext(self.nextButton, true);
(self.oncallback && self.oncallback());
};
var positionLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm); var positionLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm);
var positionlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid); var positionlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
...@@ -276,7 +271,7 @@ module STWkit { ...@@ -276,7 +271,7 @@ module STWkit {
} }
self.control.showTable(); self.control.showTable();
self.hasPosition = true; self.hasPosition = true;
validate(); self.validate();
} }
} }
}); });
...@@ -361,6 +356,13 @@ module STWkit { ...@@ -361,6 +356,13 @@ module STWkit {
super.show(); super.show();
} }
public validate() {
if (!this.hasPosition) return;
this.status = true;
AccordionCard.enableNext(this.nextButton, true);
(this.oncallback && this.oncallback());
};
public hide() { public hide() {
super.hide(); super.hide();
} }
......
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