Properly join path sections

This prevents double slashes that can mess up path comparisons in some
cases.
remotes/origin/fix-delete-homeidr-on-userdelete
Vincent Petry 9 years ago committed by Lukas Reschke
parent 7ec83fc9fb
commit ec3166742b
  1. 2
      apps/files/js/favoritesplugin.js
  2. 5
      apps/files/js/fileactions.js
  3. 2
      apps/files_external/js/app.js
  4. 2
      apps/files_sharing/js/app.js
  5. 5
      apps/files_trashbin/js/app.js

@ -92,7 +92,7 @@
// folder in the files app instead of opening it directly
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
OCA.Files.App.setActiveView('files', {silent: true});
OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true);
OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true);
});
fileActions.setDefault('dir', 'Open');
return fileActions;

@ -612,10 +612,7 @@
this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory();
if (dir !== '/') {
dir = dir + '/';
}
context.fileList.changeDirectory(dir + filename);
context.fileList.changeDirectory(OC.joinPaths(dir, filename));
});
this.registerAction({

@ -54,7 +54,7 @@ OCA.External.App = {
// folder in the files app instead of opening it directly
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
OCA.Files.App.setActiveView('files', {silent: true});
OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true);
OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true);
});
fileActions.setDefault('dir', 'Open');
return fileActions;

@ -142,7 +142,7 @@ OCA.Sharing.App = {
// folder in the files app instead of opening it directly
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
OCA.Files.App.setActiveView('files', {silent: true});
OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true);
OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true);
});
fileActions.setDefault('dir', 'Open');
return fileActions;

@ -38,10 +38,7 @@ OCA.Trashbin.App = {
var fileActions = new OCA.Files.FileActions();
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
var dir = context.fileList.getCurrentDirectory();
if (dir !== '/') {
dir = dir + '/';
}
context.fileList.changeDirectory(dir + filename);
context.fileList.changeDirectory(OC.joinPaths(dir, filename));
});
fileActions.setDefault('dir', 'Open');

Loading…
Cancel
Save