openrat-cms

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

commit 2aea34f0a7114a9b3492089811bbeb5aee40183b
parent d5a3fb7bd4d75adc91b8d3edc22f25f839cd47b6
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 23 Oct 2012 19:31:14 +0200

Baum: Falls Arry 'selectable' gefüllt, dann Ordner immer öffnen. Anklickbar sind aber nur die gewünschten Typen.

Diffstat:
themes/default/js/plugin/jquery-plugin-orTree.js | 7+++----
themes/default/templates/pageelement/edit.tpl.src.xml | 2+-
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/themes/default/js/plugin/jquery-plugin-orTree.js b/themes/default/js/plugin/jquery-plugin-orTree.js @@ -1,5 +1,5 @@ /** - * Input-Hints + * Baum darstellen. */ jQuery.fn.orTree = function( options ) { @@ -11,7 +11,6 @@ jQuery.fn.orTree = function( options ) 'selectable':Array() }, options); - $(this).each(function(idxx,treeEl) { @@ -21,7 +20,7 @@ jQuery.fn.orTree = function( options ) var output = json['output']; $.each(output['branch'],function(idx,line) { - if ( settings.selectable.length==0 || settings.selectable[0]=='' || jQuery.inArray(line.type, settings.selectable)!=-1) + if ( !line.action || line.action=='folder' || settings.selectable.length==0 || settings.selectable[0]=='' || jQuery.inArray(line.action, settings.selectable)!=-1 ) { //var img = (line.url!==undefined?'tree_plus':'tree_none'); $(ul).append( '<li class="object" data-id="'+line.internalId+'" data-type="'+line.type+'"><div class="tree">&nbsp;</div><div class="entry" data-id="'+line.internalId+'" data-type="'+line.type+'" title="'+ line.description + '"><img src="'+OR_THEMES_EXT_DIR+'default/images/icon_'+line['icon']+'.png" />'+ line.text + '</div></li>' ); @@ -33,7 +32,7 @@ jQuery.fn.orTree = function( options ) $(new_li).children('div.tree').click( function() { $(this).parent().orTree( {type:line.type,id:line.internalId,onSelect:settings.onSelect,selectable:settings.selectable} );} ); // Zweig öffnen } - if ( line.action ) + if ( line.action && ( settings.selectable.length==0 || settings.selectable[0]=='' || jQuery.inArray(line.action, settings.selectable)!=-1 )) { // Onclick-Handler für auswählbare Objekte setzen $(new_li).children('div.entry').click( function() { diff --git a/themes/default/templates/pageelement/edit.tpl.src.xml b/themes/default/templates/pageelement/edit.tpl.src.xml @@ -186,7 +186,7 @@ </part> <part class="input"> <selectbox list="objects" name="linkobjectid" addempty="true"></selectbox> - <selector types="folder,page,file,link" name="var:linkobjectid" + <selector types="page,file,link" name="var:linkobjectid" id="var:linkobjectid" folderid="var:rootfolderid" /> </part>