浏览代码

manage tree view in case of no document yet

Damien Accorsi 11 年前
父节点
当前提交
3a30f65cb9
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      pboard/pboard/templates/document.mak

+ 10 - 0
pboard/pboard/templates/document.mak 查看文件

76
         #mypodtree {overflow:hidden;}
76
         #mypodtree {overflow:hidden;}
77
         #mypodtree:hover {overflow:visible; }
77
         #mypodtree:hover {overflow:visible; }
78
       </style>
78
       </style>
79
+      <h5>${_('Content explorer')}</h5>
79
       <div id="mypodtree"></div>
80
       <div id="mypodtree"></div>
80
       <script>
81
       <script>
81
         $(function () {
82
         $(function () {
104
                 },
105
                 },
105
                 'success': function (new_data) {
106
                 'success': function (new_data) {
106
                   console.log('loaded new menu data' + new_data)
107
                   console.log('loaded new menu data' + new_data)
108
+                  console.log(new_data);
107
                   return new_data;
109
                   return new_data;
108
                 },
110
                 },
109
               },
111
               },
115
             console.log("Opening document: "+url);
117
             console.log("Opening document: "+url);
116
             location.href = url;
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
       </script>
129
       </script>
120
 ## INFO - D.A. - 2014-05-28 - Hide old school menu
130
 ## INFO - D.A. - 2014-05-28 - Hide old school menu