|
794 | 794 | if( (this._currentDirectory || this.$el.find('#dir').val()) && currentDir === e.dir) { |
795 | 795 | return; |
796 | 796 | } |
797 | | - this.changeDirectory(e.dir, false, true); |
| 797 | + this.changeDirectory(e.dir, true, true, undefined, true); |
798 | 798 | } |
799 | 799 | }, |
800 | 800 |
|
|
2057 | 2057 | * @param {boolean} [changeUrl=true] if the URL must not be changed (defaults to true) |
2058 | 2058 | * @param {boolean} [force=false] set to true to force changing directory |
2059 | 2059 | * @param {string} [fileId] optional file id, if known, to be appended in the URL |
| 2060 | + * @param {bool} [changedThroughUrl=false] true if the dir was set through a URL change |
2060 | 2061 | */ |
2061 | | - changeDirectory: function(targetDir, changeUrl, force, fileId) { |
| 2062 | + changeDirectory: function(targetDir, changeUrl, force, fileId, changedThroughUrl) { |
2062 | 2063 | var self = this; |
2063 | 2064 | var currentDir = this.getCurrentDirectory(); |
2064 | 2065 | targetDir = targetDir || '/'; |
2065 | 2066 | if (!force && currentDir === targetDir) { |
2066 | 2067 | return; |
2067 | 2068 | } |
2068 | | - this._setCurrentDir(targetDir, changeUrl, fileId); |
| 2069 | + this._setCurrentDir(targetDir, changeUrl, fileId, changedThroughUrl); |
2069 | 2070 |
|
2070 | 2071 | // discard finished uploads list, we'll get it through a regular reload |
2071 | 2072 | this._uploads = {}; |
|
2100 | 2101 | * @param targetDir directory to display |
2101 | 2102 | * @param changeUrl true to also update the URL, false otherwise (default) |
2102 | 2103 | * @param {string} [fileId] file id |
| 2104 | + * @param {bool} changedThroughUrl true if the dir was set through a URL change |
2103 | 2105 | */ |
2104 | | - _setCurrentDir: function(targetDir, changeUrl, fileId) { |
| 2106 | + _setCurrentDir: function(targetDir, changeUrl, fileId, changedThroughUrl) { |
2105 | 2107 | targetDir = targetDir.replace(/\\/g, '/'); |
2106 | 2108 | if (!this._isValidPath(targetDir)) { |
2107 | 2109 | targetDir = '/'; |
|
2133 | 2135 | if (fileId) { |
2134 | 2136 | params.fileId = fileId; |
2135 | 2137 | } |
| 2138 | + params.changedThroughUrl = changedThroughUrl |
2136 | 2139 | this.$el.trigger(jQuery.Event('changeDirectory', params)); |
2137 | 2140 | } |
2138 | 2141 | this.breadcrumb.setDirectory(this.getCurrentDirectory()); |
|
2234 | 2237 | if (status === 401) { |
2235 | 2238 | // We are not authentificated, so reload the page so that we get |
2236 | 2239 | // redirected to the login page while saving the current url. |
2237 | | - location.reload(); |
| 2240 | + location.reload(); |
2238 | 2241 | } |
2239 | 2242 |
|
2240 | 2243 | // Firewall Blocked request? |
|
0 commit comments