Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 5adfd85

Browse files
committed
New option "leavesOpenOnSelect" on search engine used in the admin panel, to avoid never-ending searching on the correct user page. Fix #814
1 parent 51c2fa5 commit 5adfd85

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function recursiveSearchGroups($baseGroup, $term)
255255
"ajxp_mime" => "user"
256256
);
257257
if(in_array($nodeKey, $this->currentBookmarks)) $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
258-
echo AJXP_XMLWriter::renderNode($nodeKey, $userId, false, $meta, true, false);
258+
echo AJXP_XMLWriter::renderNode($nodeKey, $userId, true, $meta, true, false);
259259

260260
}
261261

core/src/plugins/access.ajxp_conf/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<div ajxpClass="AjxpTabulator" id="leftTabulator" ajxpOptions='{"defaultTabId": "folders","tabInfos" : [{"id":"folders","label":"ajxp_conf.122","iconClass":"icon-cogs","element":"leftPane"},{"id":"flagged","label":"147","iconClass":"icon-bookmark","element":"flagged_elements"}],"headerToolbarOptions":{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["vertical_splitter-actions"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}}'>
8989
<div id="flagged_elements" ajxpClass="FetchedResultPane" ajxpOptions='{"nodeProviderProperties":{"get_action":"get_bookmarks", "format":"node_list"},"reloadOnServerMessage":"tree/reload_bookmarks"}'></div>
9090
<div id="leftPane" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height"}'>
91-
<div id="search_container_settings" class="settings_search_container" ajxpClass="SearchEngine" ajxpOptions='{"toggleResultsVisibility":"search_results_cont", "fitMarginBottom":10, "groupByData":false}'></div>
91+
<div id="search_container_settings" class="settings_search_container" ajxpClass="SearchEngine" ajxpOptions='{"toggleResultsVisibility":"search_results_cont", "fitMarginBottom":10, "groupByData":false, "leavesOpenOnSelect": true}'></div>
9292
<div id="settings_pane" class="flat_tree_pane" ajxpClass="FoldersTree" ajxpOptions='{"fit":"height", "fitParent":"leftPane", "display":"dz","replaceScroller":true}' ></div>
9393
</div>
9494
</div>

core/src/plugins/gui.ajax/res/js/ajaxplorer/class.RemoteNodeProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Class.create("RemoteNodeProvider", {
155155
if(console){
156156
console.log(transport.responseText);
157157
}
158-
nodeCallback(origNode);
158+
if(nodeCallback) nodeCallback(origNode);
159159
origNode.setLoaded(false);
160160
throw new Error('Invalid XML Document (see console)');
161161
}

core/src/plugins/gui.ajax/res/js/ajaxplorer/class.SearchEngine.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ Class.create("SearchEngine", AjxpPane, {
8181
if(this._ajxpOptions.openSearchInput){
8282
this.closeSearchInput();
8383
}
84-
ajaxplorer.goTo(selectedNode);
84+
if(ajxpOptions['leavesOpenOnSelect'] && selectedNode.isLeaf()){
85+
ajaxplorer.openCurrentSelectionInEditor(null, selectedNode);
86+
}else{
87+
ajaxplorer.goTo(selectedNode);
88+
}
89+
this._dataModel.setSelectedNodes([]);
8590
}
8691
}.bind(this));
8792

0 commit comments

Comments
 (0)