]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
Add button to navigate back
authorJohannes Zellner <johannes@cloudron.io>
Thu, 17 May 2018 13:05:51 +0000 (15:05 +0200)
committerJohannes Zellner <johannes@cloudron.io>
Thu, 17 May 2018 13:05:51 +0000 (15:05 +0200)
frontend/index.html
frontend/js/app.js

index f7c5ab1ec4ab23853a895dfaba42caa73357a822..19fc217db8037209554b979999ae5713b0334a07 100644 (file)
@@ -40,6 +40,9 @@
       <div style="padding: 7px;">
         <span>Surfer</span>
       </div>
+      <div>
+        <el-button type="primary" size="small" icon="el-icon-arrow-left" v-show="pathParts.slice(-1).length" @click="onUp"></el-button>
+      </div>
       <div style="flex-grow: 2; padding: 0 7px;" v-show="session.valid">
         <el-breadcrumb separator-class="el-icon-arrow-right">
           <el-breadcrumb-item><a href="#/">Path /</a></el-breadcrumb-item>
index 1500457e0a3993c402a18860ac47a7ce2d69acbc..57b831eeca698423a3e25bafcde72900fdf0d87c 100644 (file)
@@ -124,10 +124,6 @@ function open(row, event, column) {
     window.open(encode(path));
 }
 
-function up() {
-    window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/'));
-}
-
 function uploadFiles(files) {
     if (!files || !files.length) return;
 
@@ -328,7 +324,9 @@ var app = new Vue({
             return filesize(cellValue);
         },
         loadDirectory: loadDirectory,
-        up: up,
+        onUp: function () {
+            window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/'));
+        },
         open: open,
         drop: drop,
         dragOver: dragOver