diff --git a/js/app/models/PlotNode.js b/js/app/models/PlotNode.js index 39ffc76..3dc8cc3 100644 --- a/js/app/models/PlotNode.js +++ b/js/app/models/PlotNode.js @@ -32,15 +32,19 @@ Ext.define('amdaModel.PlotNode', { updateTabs : function() { if (this.get('tabs')) { - this.set('leaf', this.get('tabs').length <= 1); - this.removeAll(); - if (this.get('tabs').length > 1) { - var me = this; - Ext.Array.each(this.get('tabs'), function(tab) { - console.log(tab); - var tabNode = new amdaModel.PlotTabNode({text: tab.name, tabid: tab.id}); - me.appendChild(tabNode); - }); + var isFolder = !this.get('leaf'); + if (!isFolder) { + var oneTab = (this.get('tabs').length == 1); + this.set('leaf', oneTab); + this.set('iconCls', oneTab ? 'icon-plot-page' : 'icon-plot-pages'); + this.removeAll(); + if (this.get('tabs').length > 1) { + var me = this; + Ext.Array.each(this.get('tabs'), function(tab) { + var tabNode = new amdaModel.PlotTabNode({text: tab.name, tabid: tab.id}); + me.appendChild(tabNode); + }); + } } } }, diff --git a/js/app/models/PlotTabNode.js b/js/app/models/PlotTabNode.js index d12664b..c7321f3 100644 --- a/js/app/models/PlotTabNode.js +++ b/js/app/models/PlotTabNode.js @@ -24,6 +24,7 @@ Ext.define('amdaModel.PlotTabNode', { //this.set('objectDataModel','amdaPlotObj.PlotRequestObject'); this.set('nodeType',this.self.nodeType); this.set('leaf',true); + this.set('iconCls','icon-plot-page'); }, allMenuItems : function() { diff --git a/js/resources/css/amda.css b/js/resources/css/amda.css index 62dd854..f8c2bae 100644 --- a/js/resources/css/amda.css +++ b/js/resources/css/amda.css @@ -456,6 +456,10 @@ p + p { background-image:url( ../images/16x16/plot_page.png ) !important; } +.icon-plot-pages { + background-image:url( ../images/16x16/plot_pages.png ) !important; +} + .icon-plot-layout { background-image:url( ../images/16x16/plot_layout.png ) !important; } diff --git a/js/resources/images/16x16/plot_pages.png b/js/resources/images/16x16/plot_pages.png new file mode 100644 index 0000000..087c12b Binary files /dev/null and b/js/resources/images/16x16/plot_pages.png differ diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index f1cd21e..c82b529 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -186,8 +186,8 @@ class AmdaAction $info = $id; } - $isLeaf = empty($objplot->tabs) || count($objplot->tabs) == 1; - if (!$isLeaf) { + $isLeaf = isset($objplot->tabs); + if ($isLeaf) { foreach ($objplot->tabs as $index => $tab) { $plotTabs[$index] = array( "name" => "Plot ".($index+1), -- libgit2 0.21.2