Commit 3efc6401e07dff8a1a9ba819a12abb85f1396e99

Authored by Benjamin Renard
1 parent f31bea1c

Set icons for plot requests

js/app/models/PlotNode.js
... ... @@ -32,15 +32,19 @@ Ext.define('amdaModel.PlotNode', {
32 32  
33 33 updateTabs : function() {
34 34 if (this.get('tabs')) {
35   - this.set('leaf', this.get('tabs').length <= 1);
36   - this.removeAll();
37   - if (this.get('tabs').length > 1) {
38   - var me = this;
39   - Ext.Array.each(this.get('tabs'), function(tab) {
40   - console.log(tab);
41   - var tabNode = new amdaModel.PlotTabNode({text: tab.name, tabid: tab.id});
42   - me.appendChild(tabNode);
43   - });
  35 + var isFolder = !this.get('leaf');
  36 + if (!isFolder) {
  37 + var oneTab = (this.get('tabs').length == 1);
  38 + this.set('leaf', oneTab);
  39 + this.set('iconCls', oneTab ? 'icon-plot-page' : 'icon-plot-pages');
  40 + this.removeAll();
  41 + if (this.get('tabs').length > 1) {
  42 + var me = this;
  43 + Ext.Array.each(this.get('tabs'), function(tab) {
  44 + var tabNode = new amdaModel.PlotTabNode({text: tab.name, tabid: tab.id});
  45 + me.appendChild(tabNode);
  46 + });
  47 + }
44 48 }
45 49 }
46 50 },
... ...
js/app/models/PlotTabNode.js
... ... @@ -24,6 +24,7 @@ Ext.define(&#39;amdaModel.PlotTabNode&#39;, {
24 24 //this.set('objectDataModel','amdaPlotObj.PlotRequestObject');
25 25 this.set('nodeType',this.self.nodeType);
26 26 this.set('leaf',true);
  27 + this.set('iconCls','icon-plot-page');
27 28 },
28 29  
29 30 allMenuItems : function() {
... ...
js/resources/css/amda.css
... ... @@ -456,6 +456,10 @@ p + p {
456 456 background-image:url( ../images/16x16/plot_page.png ) !important;
457 457 }
458 458  
  459 +.icon-plot-pages {
  460 + background-image:url( ../images/16x16/plot_pages.png ) !important;
  461 +}
  462 +
459 463 .icon-plot-layout {
460 464 background-image:url( ../images/16x16/plot_layout.png ) !important;
461 465 }
... ...
js/resources/images/16x16/plot_pages.png 0 → 100644

150 Bytes

php/classes/AmdaAction.php
... ... @@ -186,8 +186,8 @@ class AmdaAction
186 186 $info = $id;
187 187 }
188 188  
189   - $isLeaf = empty($objplot->tabs) || count($objplot->tabs) == 1;
190   - if (!$isLeaf) {
  189 + $isLeaf = isset($objplot->tabs);
  190 + if ($isLeaf) {
191 191 foreach ($objplot->tabs as $index => $tab) {
192 192 $plotTabs[$index] = array(
193 193 "name" => "Plot ".($index+1),
... ...