]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - frontend/index.html
Hide rename button when rename is in action
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / index.html
index 7d60b072e78a8e828e25df0cd6c07f15de50c5b0..8cea7b9bdd32563e7f2c8bb5b208124b08b31b9d 100644 (file)
@@ -56,7 +56,7 @@
           <el-button type="primary" icon="el-icon-upload" size="small" @click="onUploadFolder">Upload Folder</el-button>
           <el-button type="primary" icon="el-icon-plus" size="small" @click="onNewFolder">New Folder</el-button>
         </el-button-group>
-        <el-dropdown @command="onOptionsMenu" :hide-on-click="false">
+        <el-dropdown @command="onOptionsMenu" :hide-on-click="false" trigger="click">
           <el-button size="small" icon="el-icon-more" id="burgerMenuButton"></el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item disabled>Public Folder Listing</el-dropdown-item>
               <img v-bind:src="scope.row.previewUrl" height="48px" width="48px"/>
             </template>
           </el-table-column>
-          <el-table-column prop="filePath" label="Name" sortable></el-table-column>
+          <el-table-column prop="filePath" label="Name" sortable>
+            <template slot-scope="scope">
+              <el-input v-on:keyup.native.enter="onRenameSubmit(scope.row)" v-on:keyup.native.esc="onRenameEnd(scope.row)" @blur="onRenameEnd(scope.row)" v-model="scope.row.filePathNew" :id="'filePathRenameInputId-' + scope.$index" v-show="scope.row.rename"></el-input>
+              <span v-show="!scope.row.rename">{{ scope.row.filePath }}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="size" label="Size" width="150px" sortable :formatter="prettyFileSize"></el-table-column>
           <el-table-column prop="mtime" label="Modified" width="150px" sortable :formatter="prettyDate"></el-table-column>
           <el-table-column label="Actions" align="right" width="200px" class-name="list-actions">
             <template slot-scope="scope">
               <el-button size="small" icon="el-icon-download" circle v-show="scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
-              <el-button size="small" icon="el-icon-edit" circle @click.stop="onRename(scope.row)"></el-button>
+              <el-button size="small" icon="el-icon-edit" circle v-show="!scope.row.rename" @click.stop="onRename(scope.row, scope)"></el-button>
               <el-button size="small" icon="el-icon-delete" circle @click.stop="onDelete(scope.row)"></el-button>
             </template>
           </el-table-column>