Przeglądaj źródła

[frontent] move removeLastSlash function up one level

Björn Alm 2 lat temu
rodzic
commit
d265748c98

+ 7 - 7
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -1452,14 +1452,14 @@ else:
         });
       };
       
-      self.allowCopyMoveTo = function (destination) {
-        const removeLastSlash = function (path) {
-          if (path.charAt(path.length - 1) === '/') {
-            return path.slice(0, -1);
-          }
-          return path;
-        };
+      const removeLastSlash = function (path) {
+        if (path.charAt(path.length - 1) === '/') {
+          return path.slice(0, -1);
+        }
+        return path;
+      };
 
+      self.allowCopyMoveTo = function (destination) {
         const source = self.currentPath();
         return removeLastSlash(source) !== removeLastSlash(destination);
       };