Commit 9b50abc6336c910f2ff17c4b2fe6526adc677abb

Authored by Elena.Budnik
1 parent 3af5d16c

nettoyage

Showing 1 changed file with 15 additions and 32 deletions   Show diff stats
js/app/models/LocalParamNode.js
... ... @@ -12,13 +12,11 @@ Ext.define('amdaModel.LocalParamNode',
12 12 {
13 13 extend: 'amdaModel.InteractiveNode',
14 14  
15   - statics:
16   - {
  15 + statics: {
17 16 nodeType: 'localParam'
18 17 },
19 18  
20   - fields:
21   - [
  19 + fields: [
22 20 {name: 'alias', type:'string', persist: false},
23 21 {name: 'isParameter', type: 'boolean', persist: false},
24 22 {name: 'notyet', type: 'boolean', defaultValue: false, persist: false},
... ... @@ -29,7 +27,12 @@ Ext.define('amdaModel.LocalParamNode',
29 27 {name: 'timeRestriction', type: 'boolean', persist: false},
30 28 {name: 'rank', type: 'integer', persist: false, defaultValue: null}
31 29 ],
32   -
  30 +
  31 + icons : {'1' : 'icon-mercury','2' : 'icon-venus','3' : 'icon-sw','4' : 'icon-sw','5' : 'icon-earth','6' : 'icon-earth',
  32 + '7' : 'icon-mars','8' : 'icon-jupiter','9' : 'icon-saturn','10' : 'icon-uranus','11' : 'icon-neptune',
  33 + '93' :'icon-comet', '99' :'icon-solarsystem', '999' :'icon-solarsystem'
  34 + },
  35 +
33 36 constructor : function(config)
34 37 {
35 38 this.callParent(arguments);
... ... @@ -40,41 +43,21 @@ Ext.define('amdaModel.LocalParamNode',
40 43  
41 44 // if future missions or 'depending on mission'
42 45 if (this.get('globalStart')) {
43   - var now = Ext.Date.format(new Date(), 'Y/m/d');
44   - if ( this.get('globalStart') > now )
45   - this.set('cls','predicted');
  46 + var now = Ext.Date.format(new Date(), 'Y/m/d');
  47 + if ( this.get('globalStart') > now )
  48 + this.set('cls','predicted');
46 49 }
47 50 // // time restriction on parameters
48 51 // if (this.get('timeRestriction')) {
49   -// // this.set('cls','predicted');
50   -// var id = this.get('id');
51   -// var bracketPos = id.indexOf("(");
52   -// if (bracketPos > 0) {
53   -// id = Ext.String.insert(id, '_restr', bracketPos);
54   -// }
55   -// else {
56   -// id += '_restr';
57   -// }
58   -// this.set('id', id);
  52 +// TBD
59 53 // }
60   -
  54 +
61 55 if (this.get('rank')) {
62 56 var rank = this.get('rank');
63   - if (rank == 1) this.set('iconCls', 'icon-mercury');
64   - if (rank == 2) this.set('iconCls', 'icon-venus');
65   - if (rank == 5 || rank == 6) this.set('iconCls', 'icon-earth');
66   - if (rank == 7) this.set('iconCls', 'icon-mars');
67   - if (rank == 8) this.set('iconCls', 'icon-jupiter');
68   - if (rank == 9) this.set('iconCls', 'icon-saturn');
69   - if (rank == 10) this.set('iconCls', 'icon-uranus');
70   - if (rank == 11) this.set('iconCls', 'icon-neptune');
71   - if (rank == 93) this.set('iconCls', 'icon-comet');
72   - if (rank == 3 || rank == 4) this.set('iconCls', 'icon-sw');
73   - if (rank >= 99) this.set('iconCls', 'icon-solarsystem');
  57 + this.set('iconCls', this.icons[rank]);
74 58 }
75 59  
76   - if (this.get('isParameter'))
77   - {
  60 + if (this.get('isParameter')) {
78 61 if (this.get('leaf'))
79 62 this.set('iconCls', 'icon-scalar');
80 63 else
... ...