fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [14623] alternative


From: Sigurd Nes
Subject: [Fmsystem-commits] [14623] alternative
Date: Tue, 05 Jan 2016 10:31:43 +0000

Revision: 14623
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14623
Author:   sigurdne
Date:     2016-01-05 10:31:42 +0000 (Tue, 05 Jan 2016)
Log Message:
-----------
alternative

Modified Paths:
--------------
    branches/dev-syncromind/phpgwapi/templates/portico/js/ajax_jsmenu.js

Modified: branches/dev-syncromind/phpgwapi/templates/portico/js/ajax_jsmenu.js
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/portico/js/ajax_jsmenu.js        
2016-01-05 08:54:38 UTC (rev 14622)
+++ branches/dev-syncromind/phpgwapi/templates/portico/js/ajax_jsmenu.js        
2016-01-05 10:31:42 UTC (rev 14623)
@@ -1,6 +1,6 @@
 $(function () {
-
-       $('#navbar').jstree({
+/*
+       $('#navbar_').jstree({
                'core': {
                        'data': {
                                'url': function (node) {
@@ -34,7 +34,69 @@
                plugins: ["state", "search"]
 
        });
+       $('#navbar_').bind('select_node.jstree', function (e, data) {
+               if (typeof (data.event) == 'undefined')
+               {
+                       return false;
+               }
+               setTimeout(function () {
+                       window.location.href = data.node.original.url;
+               }, 200);
 
+       });
+*/
+       $("#navbar")
+    .on("select_node.jstree", function (e, data) {
+               if (typeof (data.event) == 'undefined')
+               {
+                       return false;
+               }
+//             console.log(data);return
+
+/*     
+      console.log(data.changed.selected); // newly selected
+      console.log(data.changed.deselected); // newly deselected
+*/
+         setTimeout(function () {
+                       window.location.href = data.node.original.url;
+               }, 200);
+
+    })
+    .jstree({
+               'core': {
+                       'data': {
+                               'url': function (node) {
+
+//                                     console.log(node);
+
+                                       var oArgs = {};
+                                       if(node.id === '#')
+                                       {
+                                               oArgs 
={menuaction:'phpgwapi.menu.get_local_menu_ajax',node:'top_level'};
+                                       }
+                                       else
+                                       {
+
+                                               var app = node.original.app;
+                                               if(typeof(node.original.key) 
!== 'undefined')
+                                               {
+                                                       app += '|' + 
node.original.key;
+                                               }
+
+                                               oArgs 
={menuaction:'phpgwapi.menu.get_local_menu_ajax',node: app};
+                                       }
+
+                                       return phpGWLink('index.php', oArgs, 
true);
+                               },
+                               'data': function (node) {
+                                       return {'id': node.id};
+                               },
+                               href: { href: "URI" }
+                       }
+               },
+      "plugins" : ["state", "search", "changed" ]
+    });
+
        var to = false;
 
        $('#navbar_search').hide();
@@ -61,15 +123,4 @@
                }, 250);
        });
 
-
-       $('#navbar').bind('select_node.jstree', function (e, data) {
-               if (typeof (data.event) == 'undefined')
-               {
-                       return false;
-               }
-               setTimeout(function () {
-                       window.location.href = data.node.original.url;
-               }, 200);
-
-       });
 });




reply via email to

[Prev in Thread] Current Thread [Next in Thread]