New File and New DIr working :D
parent
6626398cdf
commit
59912e1dda
|
@ -17,26 +17,6 @@ listing.redefineDownloadURLs = function () {
|
|||
})
|
||||
}
|
||||
|
||||
listing.newFilePrompt = function (event) {
|
||||
event.preventDefault()
|
||||
buttons.setLoading('new')
|
||||
|
||||
let name = event.currentTarget.querySelector('input').value
|
||||
|
||||
webdav.new(window.location.pathname + name)
|
||||
.then(() => {
|
||||
buttons.setDone('new')
|
||||
listing.reload()
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
buttons.setDone('new', false)
|
||||
})
|
||||
|
||||
closePrompt(event)
|
||||
return false
|
||||
}
|
||||
|
||||
listing.addDoubleTapEvent = function () {
|
||||
let items = document.getElementsByClassName('item'),
|
||||
touches = {
|
||||
|
|
|
@ -21,10 +21,20 @@
|
|||
<i class="material-icons">folder</i>
|
||||
<span>My Files</span>
|
||||
</a>
|
||||
<div class="action" id="logout" tabindex="0" role="button" aria-label="Log out">
|
||||
<div v-if="user.allowNew">
|
||||
<button @click="showNewDir = true" aria-label="New directory" title="New directory" class="action">
|
||||
<i class="material-icons">create_new_folder</i>
|
||||
<span>New folder</span>
|
||||
</button>
|
||||
<button @click="showNewFile = true" aria-label="New file" title="New file" class="action">
|
||||
<i class="material-icons">note_add</i>
|
||||
<span>New file</span>
|
||||
</button>
|
||||
</div>
|
||||
<button class="action" id="logout" tabindex="0" role="button" aria-label="Log out">
|
||||
<i class="material-icons" title="Logout">exit_to_app</i>
|
||||
<span>Logout</span>
|
||||
</div>
|
||||
</button>
|
||||
</nav>
|
||||
<main>
|
||||
<listing v-if="req.kind === 'listing'"></listing>
|
||||
|
|
|
@ -372,6 +372,11 @@ fieldset h3,
|
|||
padding: .5em;
|
||||
}
|
||||
|
||||
#sidebar > div {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
#sidebar .action>* {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue