openrat-cms

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

commit 264534cb07efb4b83cc16e65822c79a60cbb47f4
parent 16d83fbc257b6fc376b98bc0a4e4d88a2bd2febc
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 31 Jan 2018 23:52:04 +0100

Nur noch die 1. Ebene automatisch öffnen, da es sonst zu unübersichtlich wird.

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 | 4++--
2 files changed, 3 insertions(+), 3 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 @@ -55,7 +55,7 @@ jQuery.fn.orTree = function( options ) //$(new_li).children('div.entry').draggable( {cursor:'move',revert: 'invalid' }); } - if ($(new_li).parents('ul.tree').length <= 2 ) + if ($(new_li).parents('ul.tree').length <= 1 ) { // Falls eine bestimmte Tiefe nicht erreicht ist, dann // den Pfad auch gleich öffnen. 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 +1 @@ -;jQuery.fn.orTree=function(t){var e=$.extend({'onSelect':function(){},'type':'root','id':0,'selectable':Array()},t);$(this).each(function(n,t){$(t).closest('div.content').addClass('loader');$.getJSON('./api/?action=tree&subaction=loadBranch&id='+e.id+'&type='+e.type+'&output=json',function(i){$(t).append('<ul class="tree"/>');var n=$(t).children('ul').first(),l=i['output'];$.each(l['branch'],function(i,t){if(!t.action||t.action=='folder'||e.selectable.length==0||e.selectable[0]==''||jQuery.inArray(t.action,e.selectable)!=-1){$(n).append('<li class="object" data-id="'+t.internalId+'" data-type="'+t.type+'"><div class="tree">&nbsp;</div><div class="entry" data-id="'+t.internalId+'" data-type="'+t.type+'" title="'+t.description+'"><img src="modules/cms-ui/themes/default/images/icon_'+t['icon']+'.png" />'+t.text+'</div></li>');var l=$(n).children('li').last();if(t.type){$(l).children('div.tree').addClass('closed');$(l).children('div.tree').click(function(){$(this).parent().orTree({type:t.type,id:t.internalId,onSelect:e.onSelect,selectable:e.selectable})})};if(t.action&&(e.selectable.length==0||e.selectable[0]==''||jQuery.inArray(t.action,e.selectable)!=-1)){$(l).children('div.entry').click(function(){$(this).closest('div.content').find('div.entry').removeClass('selected');$(this).addClass('selected');e.onSelect($(this).text(),t.action,t.id)})};if($(l).parents('ul.tree').length<=2){$(l).children('div.tree').click()}}});$(n).slideDown('fast')}).fail(function(){}).always(function(){$(t).closest('div.content').removeClass('loader')});$(t).children('div.tree').unbind('click');$(t).children('div.tree').removeClass('closed').addClass('open');$(t).children('div.tree').click(function(t){i($(t.target).parent(),e.type,e.id)})});function i(t,i,n){$(t).children('ul').slideUp('fast',function(){$(t).children('ul').remove();$(t).children('div.tree').unbind('click');$(t).children('div.tree').removeClass('open').addClass('closed');$(t).children('div.tree').click(function(){$(this).parent().orTree({type:i,id:n,onSelect:e.onSelect,selectable:e.selectable})})})}};- \ No newline at end of file +;jQuery.fn.orTree=function(t){var e=$.extend({'onSelect':function(){},'type':'root','id':0,'selectable':Array()},t);$(this).each(function(n,t){$(t).closest('div.content').addClass('loader');$.getJSON('./api/?action=tree&subaction=loadBranch&id='+e.id+'&type='+e.type+'&output=json',function(i){$(t).append('<ul class="tree"/>');var n=$(t).children('ul').first(),l=i['output'];$.each(l['branch'],function(i,t){if(!t.action||t.action=='folder'||e.selectable.length==0||e.selectable[0]==''||jQuery.inArray(t.action,e.selectable)!=-1){$(n).append('<li class="object" data-id="'+t.internalId+'" data-type="'+t.type+'"><div class="tree">&nbsp;</div><div class="entry" data-id="'+t.internalId+'" data-type="'+t.type+'" title="'+t.description+'"><img src="modules/cms-ui/themes/default/images/icon_'+t['icon']+'.png" />'+t.text+'</div></li>');var l=$(n).children('li').last();if(t.type){$(l).children('div.tree').addClass('closed');$(l).children('div.tree').click(function(){$(this).parent().orTree({type:t.type,id:t.internalId,onSelect:e.onSelect,selectable:e.selectable})})};if(t.action&&(e.selectable.length==0||e.selectable[0]==''||jQuery.inArray(t.action,e.selectable)!=-1)){$(l).children('div.entry').click(function(){$(this).closest('div.content').find('div.entry').removeClass('selected');$(this).addClass('selected');e.onSelect($(this).text(),t.action,t.id)})};if($(l).parents('ul.tree').length<=1){$(l).children('div.tree').click()}}});$(n).slideDown('fast')}).fail(function(){}).always(function(){$(t).closest('div.content').removeClass('loader')});$(t).children('div.tree').unbind('click');$(t).children('div.tree').removeClass('closed').addClass('open');$(t).children('div.tree').click(function(t){i($(t.target).parent(),e.type,e.id)})});function i(t,i,n){$(t).children('ul').slideUp('fast',function(){$(t).children('ul').remove();$(t).children('div.tree').unbind('click');$(t).children('div.tree').removeClass('open').addClass('closed');$(t).children('div.tree').click(function(){$(this).parent().orTree({type:i,id:n,onSelect:e.onSelect,selectable:e.selectable})})})}};+ \ No newline at end of file