From 72481769e6152d6edeb89add20657adf6f53aa91 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Wed, 30 Dec 2015 15:48:03 +0100 Subject: [PATCH] Pass optional parameters to the node->load() method. --- core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6 | 5 +++-- .../gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6 b/core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6 index c634b8f629..7a47bba847 100644 --- a/core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6 +++ b/core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6 @@ -49,8 +49,9 @@ class AjxpNode extends Observable{ /** * Loads the node using its own provider or the one passed * @param iAjxpNodeProvider IAjxpNodeProvider Optionnal + * @param additionalParameters Object of optional parameters */ - load(iAjxpNodeProvider){ + load(iAjxpNodeProvider, additionalParameters=null){ if(this._isLoading) return; if(!iAjxpNodeProvider){ if(this._iNodeProvider){ @@ -71,7 +72,7 @@ class AjxpNode extends Observable{ this._isLoading = false; this.notify("loaded"); this.notify("first_load"); - }.bind(this)); + }.bind(this), null, false, -1, additionalParameters); } /** * Remove children and reload node diff --git a/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 b/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 index fefbe69863..09d974b230 100644 --- a/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 +++ b/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 @@ -52,8 +52,9 @@ class RemoteNodeProvider{ * @param childCallback Function On child added * @param recursive * @param depth + * @param optionalParameters */ - loadNode (node, nodeCallback=null, childCallback=null, recursive=false, depth=-1){ + loadNode (node, nodeCallback=null, childCallback=null, recursive=false, depth=-1, optionalParameters=null){ var params = { get_action:'ls', options:'al' @@ -81,6 +82,9 @@ class RemoteNodeProvider{ params[key] = value + (key == 'dir' && paginationHash ? paginationHash :''); }); } + if(optionalParameters){ + params = LangUtils.objectMerge(params, optionalParameters); + } var complete = function (transport){ this.parseNodes(node, transport, nodeCallback, childCallback); }.bind(this);