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

Commit

Permalink
Pass optional parameters to the node->load() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Dec 30, 2015
1 parent 2beca40 commit 7248176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/src/plugins/gui.ajax/res/js/es6/model/AjxpNode.es6
Expand Up @@ -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){
Expand All @@ -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
Expand Down
Expand Up @@ -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'
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7248176

Please sign in to comment.