Browse Source

manage tree view in case of no document yet

Damien Accorsi 10 years ago
parent
commit
3a30f65cb9
1 changed files with 10 additions and 0 deletions
  1. 10 0
      pboard/pboard/templates/document.mak

+ 10 - 0
pboard/pboard/templates/document.mak View File

@@ -76,6 +76,7 @@
76 76
         #mypodtree {overflow:hidden;}
77 77
         #mypodtree:hover {overflow:visible; }
78 78
       </style>
79
+      <h5>${_('Content explorer')}</h5>
79 80
       <div id="mypodtree"></div>
80 81
       <script>
81 82
         $(function () {
@@ -104,6 +105,7 @@
104 105
                 },
105 106
                 'success': function (new_data) {
106 107
                   console.log('loaded new menu data' + new_data)
108
+                  console.log(new_data);
107 109
                   return new_data;
108 110
                 },
109 111
               },
@@ -115,6 +117,14 @@
115 117
             console.log("Opening document: "+url);
116 118
             location.href = url;
117 119
           });
120
+          
121
+          $('#mypodtree').on("loaded.jstree", function () {
122
+            nodes = $('#mypodtree .jstree-node');
123
+            console.log("nodes = "+nodes.length);
124
+            if (nodes.length<=0) {
125
+              $("#mypodtree").append( "<p class='pod-grey'>${_('There is no content yet.')|n}</p>" );
126
+            }
127
+          });
118 128
         });
119 129
       </script>
120 130
 ## INFO - D.A. - 2014-05-28 - Hide old school menu