Stop using window.info on webdav
parent
4efdf9c547
commit
01c78d2b36
|
@ -1,50 +0,0 @@
|
||||||
export default {
|
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
buttonState: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
setLoading: function () {
|
|
||||||
let i = this.$el.querySelector('i')
|
|
||||||
i.style.opacity = 0
|
|
||||||
|
|
||||||
this.buttonState = i.innerHTML
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
i.classList.add('spin')
|
|
||||||
i.innerHTML = 'autorenew'
|
|
||||||
i.style.opacity = 1
|
|
||||||
}, 200)
|
|
||||||
},
|
|
||||||
setDone: function (success = true) {
|
|
||||||
let i = this.$el.querySelector('i')
|
|
||||||
i.style.opacity = 0
|
|
||||||
|
|
||||||
let thirdStep = () => {
|
|
||||||
i.innerHTML = this.buttonState
|
|
||||||
i.style.opacity = null
|
|
||||||
}
|
|
||||||
|
|
||||||
let secondStep = () => {
|
|
||||||
i.style.opacity = 0
|
|
||||||
setTimeout(thirdStep, 200)
|
|
||||||
}
|
|
||||||
|
|
||||||
let firstStep = () => {
|
|
||||||
i.classList.remove('spin')
|
|
||||||
i.innerHTML = success
|
|
||||||
? 'done'
|
|
||||||
: 'close'
|
|
||||||
i.style.opacity = 1
|
|
||||||
setTimeout(secondStep, 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(firstStep, 200)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* // third step ?
|
|
||||||
if (selectedItems.length === 0 && document.getElementById('listing')) {
|
|
||||||
document.sendCostumEvent('changed-selected')
|
|
||||||
} */
|
|
|
@ -1,8 +1,7 @@
|
||||||
// TODO: use store
|
import store from '../store/store'
|
||||||
var $ = window.info
|
|
||||||
|
|
||||||
function convertURL (url) {
|
function convertURL (url) {
|
||||||
return window.location.origin + url.replace($.baseURL + '/', $.webdavURL + '/')
|
return window.location.origin + url.replace(store.state.baseURL + '/', store.state.webDavURL + '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
function move (oldLink, newLink) {
|
function move (oldLink, newLink) {
|
||||||
|
@ -10,8 +9,8 @@ function move (oldLink, newLink) {
|
||||||
let request = new window.XMLHttpRequest()
|
let request = new window.XMLHttpRequest()
|
||||||
|
|
||||||
oldLink = convertURL(oldLink)
|
oldLink = convertURL(oldLink)
|
||||||
newLink = newLink.replace($.baseURL + '/', $.webdavURL + '/')
|
newLink = newLink.replace(store.state.baseURL + '/', store.state.webDavURL + '/')
|
||||||
newLink = window.location.origin + newLink.substring($.baseURL.length)
|
newLink = window.location.origin + newLink.substring(store.state.baseURL.length)
|
||||||
|
|
||||||
request.open('MOVE', oldLink, true)
|
request.open('MOVE', oldLink, true)
|
||||||
request.setRequestHeader('Destination', newLink)
|
request.setRequestHeader('Destination', newLink)
|
||||||
|
|
Loading…
Reference in New Issue