Commit e5c98474 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

added oiltypecard

parent 2e9d8897
...@@ -153,23 +153,6 @@ ...@@ -153,23 +153,6 @@
}; };
if (forcing.features.length > 0) properties["forcing"] = forcing; if (forcing.features.length > 0) properties["forcing"] = forcing;
// SimpleCardControl = STWkit.CardControl.extend({
// setup: function (map) {
// this.container = STWkit.DomUtil.create('div', +self.name+'-control');
// this.accordionDiv = STWkit.DomUtil.create('div', 'uk-accordion', this.container);
// var locationid = self.initials+'locationCard';
// self.cardMap[locationid] = new Location(locationid, this.accordionDiv, self.lang, self.langData, map, self.forcing);
// self.cardMap[locationid].show();
// // super.setup(map);
// },
// show: function() {},
// // ready: function(name) {super.ready(name)},
// // clear: function() {super.clear()},
// // hide: function() {super.hide()}
// });
class SimpleCardControl extends STWkit.CardControl { class SimpleCardControl extends STWkit.CardControl {
constructor(options) {super(options);} constructor(options) {super(options);}
setup(map) { setup(map) {
...@@ -196,16 +179,28 @@ ...@@ -196,16 +179,28 @@
// periodoptions['forwardbackward'] = false; // periodoptions['forwardbackward'] = false;
var periodid = 'periodCard'; var periodid = 'periodCard';
this.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, this.lang, map, this.domain, this.forcingmodel, periodoptions); this.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, this.lang, map, this.domain, this.forcingmodel, periodoptions);
var oiltypeoptions = {};
oiltypeoptions['type'] = type;
oiltypeoptions['initials'] = initials;
var oiltypeid = 'oiltypeCard';
this.cardMap[oiltypeid] = new STWkit.OilTypeCard(oiltypeid, 'Type of oil', this.accordionDiv, this.lang, map, oiltypeoptions);
this.cardMap[periodid].addChangeFnListener(this.cardMap[oiltypeid]);
super.setup(map); super.setup(map);
var chain = []; var chain = [];
chain[locationid] = periodid; chain[locationid] = periodid;
chain[periodid] = ''; chain[periodid] = oiltypeid;
chain[oiltypeid] = '';
this.cardMap[locationid].oncallback = (gonext) => { this.cardMap[locationid].oncallback = (gonext) => {
super.callback(chain, locationid, gonext); super.callback(chain, locationid, gonext);
}; };
this.cardMap[periodid].oncallback = (gonext) => { this.cardMap[periodid].oncallback = (gonext) => {
super.callback(chain, periodid, gonext); super.callback(chain, periodid, gonext);
}; };
this.cardMap[oiltypeid].oncallback = (gonext) => {
super.callback(chain, oiltypeid, gonext);
};
} }
show() {} show() {}
hide() {} hide() {}
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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