Commit b350c87a7ba4341c7d7b97eac1236779a8f70bd1

Authored by Benjamin Renard
1 parent 17ac91c7

Fix color map selection in DefaultValuesWindow

js/app/views/ColorMap.js
@@ -21,11 +21,15 @@ Ext.define('amdaUI.ColorMap', { @@ -21,11 +21,15 @@ Ext.define('amdaUI.ColorMap', {
21 init: function(config){ 21 init: function(config){
22 var me = this; 22 var me = this;
23 var size = (typeof config !== "undefined" && config.size) ? config.size : '12'; 23 var size = (typeof config !== "undefined" && config.size) ? config.size : '12';
  24 + var hideFieldLabel = true;
  25 + if (typeof config !== "undefined") {
  26 + hideFieldLabel = (config.hideFieldLabel !== false);
  27 + }
24 Ext.apply(this,{ 28 Ext.apply(this,{
25 xtype:'combobox', 29 xtype:'combobox',
26 name: (typeof config !== "undefined" && config.name) ? config.name:null, 30 name: (typeof config !== "undefined" && config.name) ? config.name:null,
27 - fieldLabel: 'Color Map&nbsp;<img amda_clicktip="colourMaps" style="vertical-align:bottom" src="js/resources/images/16x16/info_mini.png"',  
28 - store: new Ext.data.Store({ 31 + fieldLabel: hideFieldLabel ? '' : 'Color Map&nbsp;<img amda_clicktip="colourMaps" style="vertical-align:bottom" src="js/resources/images/16x16/info_mini.png"',
  32 + store: new Ext.data.Store({
29 fields: ['key','name', 'iconUrl'], 33 fields: ['key','name', 'iconUrl'],
30 data: me.data 34 data: me.data
31 }), 35 }),
@@ -37,7 +41,7 @@ Ext.define(&#39;amdaUI.ColorMap&#39;, { @@ -37,7 +41,7 @@ Ext.define(&#39;amdaUI.ColorMap&#39;, {
37 </div></tpl>', 41 </div></tpl>',
38 editable: false, 42 editable: false,
39 queryMode: 'local', 43 queryMode: 'local',
40 - onValueChange: config.onValueChange, 44 + onValueChange: (typeof config !== "undefined" && config.onValueChange) ? config.onValueChange : null,
41 listeners: { 45 listeners: {
42 change: function (combo, newValue, oldValue, eOpts) { 46 change: function (combo, newValue, oldValue, eOpts) {
43 var iconUrl=""; 47 var iconUrl="";
js/app/views/PlotComponents/PlotStandardForm.js
@@ -441,6 +441,7 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, { @@ -441,6 +441,7 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, {
441 xtype: 'colormap', 441 xtype: 'colormap',
442 name: name, 442 name: name,
443 size: 26, 443 size: 26,
  444 + hideFieldLabel: false,
444 onValueChange: function(name, newValue, oldValue) { 445 onValueChange: function(name, newValue, oldValue) {
445 me.object.set(name, newValue); 446 me.object.set(name, newValue);
446 if (onChange != null) 447 if (onChange != null)