Skip to content

Commit

Permalink
Merge pull request Studio-42#252 from dairiki/customData-in-url-params
Browse files Browse the repository at this point in the history
Include customData in params in url to file using the 'file' command
  • Loading branch information
troex committed Apr 9, 2012
2 parents fabd82a + 11a5fdd commit 7dd7c7f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,16 @@ window.elFinder = function(node, opts) {
if (cwdOptions.url) {
return cwdOptions.url + $.map(this.path2array(hash), function(n) { return encodeURIComponent(n); }).slice(1).join('/')
}

return this.options.url + (this.options.url.indexOf('?') === -1 ? '?' : '&') + (this.oldAPI ? 'cmd=open&current='+file.phash : 'cmd=file') + '&target=' + file.hash;

var params = $.extend({}, this.customData, {
cmd: 'file',
target: file.hash
});
if (this.oldAPI) {
params.cmd = 'open';
params.current = file.phash;
}
return this.options.url + (this.options.url.indexOf('?') === -1 ? '?' : '&') + $.param(params, true);
}

/**
Expand Down

0 comments on commit 7dd7c7f

Please sign in to comment.