summaryrefslogtreecommitdiffstats
path: root/apps/files/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/app.js')
-rw-r--r--apps/files/js/app.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index 60b5f1816ab..7a3d78f9663 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -271,6 +271,19 @@
},
/**
+ * Encode URL params into a string, except for the "dir" attribute
+ * that gets encoded as path where "/" is not encoded
+ *
+ * @param {Object.<string>} params
+ * @return {string} encoded params
+ */
+ _makeUrlParams: function(params) {
+ var dir = params.dir;
+ delete params.dir;
+ return 'dir=' + OC.encodePath(dir) + '&' + OC.buildQueryString(params);
+ },
+
+ /**
* Change the URL to point to the given dir and view
*/
_changeUrl: function(view, dir, fileId) {
@@ -283,9 +296,9 @@
var currentParams = OC.Util.History.parseUrlQuery();
if (currentParams.dir === params.dir && currentParams.view === params.view && currentParams.fileid !== params.fileid) {
// if only fileid changed or was added, replace instead of push
- OC.Util.History.replaceState(params);
+ OC.Util.History.replaceState(this._makeUrlParams(params));
} else {
- OC.Util.History.pushState(params);
+ OC.Util.History.pushState(this._makeUrlParams(params));
}
}
};