openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8a2335526e490974a3a5f660d306703d506da81d
parent a015427579700f1abdd2ea03b7571d1e9022d32b
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 21 Sep 2018 00:19:30 +0200

Fix: Eventhandler für Navigation-Tree nur 1x setzen.

Diffstat:
modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.js | 2+-
modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.min.js | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.js b/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.js @@ -6,7 +6,7 @@ jQuery.fn.orTree = function () $(this).each(function (idxx, treeEl) { // Klick-Funktion zum Öffnen des Zweiges. - $(treeEl).find('.or-navtree-node-control').click( function () + $(treeEl).children('.or-navtree-node-control').click( function () { var node = $(this).parent('.or-navtree-node'); diff --git a/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.min.js b/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orTree.min.js @@ -1,4 +1,4 @@ -;jQuery.fn.orTree=function(){$(this).each(function(a,e){$(e).find('.or-navtree-node-control').click(function(){var a=$(this).parent('.or-navtree-node');if($(a).is('.or-navtree-node--is-open')){$(a).children('ul').slideUp('fast').remove();$(a).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.arrow').removeClass('arrow-down').addClass('arrow-right')} +;jQuery.fn.orTree=function(){$(this).each(function(a,e){$(e).children('.or-navtree-node-control').click(function(){var a=$(this).parent('.or-navtree-node');if($(a).is('.or-navtree-node--is-open')){$(a).children('ul').slideUp('fast').remove();$(a).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.arrow').removeClass('arrow-down').addClass('arrow-right')} else{$(e).closest('div.content').addClass('loader');var t=$(a).data('type'),o=$(a).data('id'),r=$(a).data('extra'),n='./api/?action=tree&subaction=loadBranch&id='+o+'&type='+t+'&output=json';if(typeof r==='string'){jQuery.each(jQuery.parseJSON(r),function(e,a){n=n+'&'+e+'='+a})} else if(typeof r==='object'){jQuery.each(r,function(e,a){n=n+'&'+e+'='+a})} else{};$.getJSON(n,function(a){$(e).append('<ul class="or-navtree-list"/>');var n=$(e).children('ul').first(),r=a['output'];$.each(r['branch'],function(a,e){var r=$('<li class="or-navtree-node or-navtree-node--is-closed" data-id="'+e.internalId+'" data-type="'+e.type+'"><div class="tree or-navtree-node-control"><div class="arrow arrow-right"></div></div><div class="clickable"><a href="./?action='+e.action+'&id='+e.internalId+'" class="entry" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'" data-id="'+e.internalId+'" data-action="'+e.action+'" data-type="open" title="'+e.description+'"><img src="modules/cms-ui/themes/default/images/icon_'+e['icon']+'.png" />'+e.text+'</a></div></li>');$(n).append(r);$(r).orTree();$(r).find('.clickable').orLinkify();$(r).find('.clickable a').click(function(e){e.preventDefault()})});$(n).slideDown('fast')}).fail(function(){}).always(function(){$(e).closest('div.content').removeClass('loader')});$(a).addClass('or-navtree-node--is-open').removeClass('or-navtree-node--is-closed').find('.arrow').addClass('arrow-down').removeClass('arrow-right')}})})}; \ No newline at end of file