Změny dokumentu Tree Macro
Naposledy upravil David Brazda 11.01.2021 09:23
Popis verze:
Install extension [org.xwiki.platform:xwiki-platform-tree-macro/12.9]
Přehled
-
Objects (1 změněno, 0 přidáno, 0 odstraněno)
Rozpis
- XWiki.JavaScriptExtension[0]
-
- Kód
-
... ... @@ -1,19 +1,29 @@ 1 1 require(['jquery', "$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'require-config.min.js', {'evaluate': true})"], function($) { 2 - $('.jstree-xwiki').on("click", ".jstree-anchor", function (e, data) { 3 - e.preventDefault(); 4 - e.stopPropagation(); 5 - e.stopImmediatePropagation(); 6 - return false; 7 - alert("clicked:"+this.href); 8 - }), 2 + 3 + $(window.top).on('click', function(evt) { 4 + evt.preventDefault(); 5 + // Do whatever logic here 6 +}), 7 + 8 + $(document).ready(function(){ 9 + $("a.jstree-anchor").click(function(ev){ 10 + ev.preventDefault(); 11 + alert("clicked AAA:"+this.href); 12 + });//click 13 + }),//ready 9 9 require(['tree'], function($) { 10 - $('.jstree-xwiki').on("click", ".jstree-anchor", function (e, data) { 15 + $(document).ready(function(){ 16 + //$('.jstree').on("click", ".jstree-anchor", function (e, data) { 17 + //$('.xtree').on("activate_node.jstree", function (e, data) { 18 + $('.xtree').delegate("a.jstree-anchor", "click", function (event, data) { event.preventDefault(); }), 19 + $('.xtree').on("click", "a.jstree-anchor", function (e, data) { 11 11 e.preventDefault(); 12 12 e.stopPropagation(); 13 13 e.stopImmediatePropagation(); 14 14 $("#contentcolumn").load(this.href + " #contentcolumn" ); 15 15 return false; 16 - alert("clicked:"+this.href); 17 - }); 18 - }); 25 + alert("activated:"+this.href); 26 + });//onclick 27 + });//ready 28 + });//require 19 19 });