parent
114aaf0c13
commit
7fd6cdc22c
7 changed files with 43 additions and 39 deletions
|
@ -146,10 +146,13 @@
|
||||||
type: ({ media }) => media.type
|
type: ({ media }) => media.type
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onClick () {
|
onClick () {
|
||||||
|
(async () => {
|
||||||
let { mediaAttachments, index } = this.get()
|
let { mediaAttachments, index } = this.get()
|
||||||
let showMediaDialog = await importShowMediaDialog()
|
let showMediaDialog = await importShowMediaDialog()
|
||||||
showMediaDialog(mediaAttachments, index)
|
showMediaDialog(mediaAttachments, index)
|
||||||
|
})()
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
|
@ -197,21 +197,20 @@
|
||||||
let isClick = type === 'click'
|
let isClick = type === 'click'
|
||||||
let isEnter = type === 'keydown' && keyCode === 13
|
let isEnter = type === 'keydown' && keyCode === 13
|
||||||
if (!isClick && !isEnter) {
|
if (!isClick && !isEnter) {
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
if (checkDomAncestors(target, isUserInputElement, isStatusArticle)) {
|
if (checkDomAncestors(target, isUserInputElement, isStatusArticle)) {
|
||||||
// this element or any ancestors up to the status-article element is
|
// this element or any ancestors up to the status-article element is
|
||||||
// a user input element
|
// a user input element
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
if (checkDomAncestors(target, isToolbar, isStatusArticle)) {
|
if (checkDomAncestors(target, isToolbar, isStatusArticle)) {
|
||||||
// this element or any of its ancestors is the toolbar
|
// this element or any of its ancestors is the toolbar
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
this.open()
|
this.open()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
open () {
|
open () {
|
||||||
let { originalStatusId } = this.get()
|
let { originalStatusId } = this.get()
|
||||||
|
|
|
@ -190,6 +190,7 @@
|
||||||
sensitivesShown[uuid] = !sensitivesShown[uuid]
|
sensitivesShown[uuid] = !sensitivesShown[uuid]
|
||||||
this.store.set({ sensitivesShown })
|
this.store.set({ sensitivesShown })
|
||||||
this.fire('recalculateHeight')
|
this.fire('recalculateHeight')
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,9 +287,8 @@
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onRefreshClick (e) {
|
onRefreshClick () {
|
||||||
e.preventDefault()
|
(async () => {
|
||||||
e.stopPropagation()
|
|
||||||
let { pollId } = this.get()
|
let { pollId } = this.get()
|
||||||
this.set({ loading: true })
|
this.set({ loading: true })
|
||||||
try {
|
try {
|
||||||
|
@ -302,6 +301,8 @@
|
||||||
} finally {
|
} finally {
|
||||||
this.set({ loading: false })
|
this.set({ loading: false })
|
||||||
}
|
}
|
||||||
|
})()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
async onSubmit (e) {
|
async onSubmit (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
this.fire('recalculateHeight')
|
this.fire('recalculateHeight')
|
||||||
stop('clickSpoilerButton')
|
stop('clickSpoilerButton')
|
||||||
})
|
})
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,22 +77,22 @@
|
||||||
optionsKey
|
optionsKey
|
||||||
} = this.get()
|
} = this.get()
|
||||||
registerClickDelegates(this, {
|
registerClickDelegates(this, {
|
||||||
[favoriteKey]: (e) => {
|
[favoriteKey]: () => {
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
this.toggleFavorite()
|
this.toggleFavorite()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
[reblogKey]: (e) => {
|
[reblogKey]: () => {
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
this.reblog()
|
this.reblog()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
[replyKey]: (e) => {
|
[replyKey]: () => {
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
this.reply()
|
this.reply()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
[optionsKey]: (e) => this.onOptionsClick(e)
|
[optionsKey]: () => {
|
||||||
|
this.onOptionsClick()
|
||||||
|
return true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
on('postedStatus', this, this.onPostedStatus)
|
on('postedStatus', this, this.onPostedStatus)
|
||||||
},
|
},
|
||||||
|
@ -127,9 +127,7 @@
|
||||||
this.fire('recalculateHeight')
|
this.fire('recalculateHeight')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async onOptionsClick (e) {
|
async onOptionsClick () {
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
let { originalStatus, originalAccountId } = this.get()
|
let { originalStatus, originalAccountId } = this.get()
|
||||||
let updateRelationshipPromise = updateProfileAndRelationship(originalAccountId)
|
let updateRelationshipPromise = updateProfileAndRelationship(originalAccountId)
|
||||||
let showStatusOptionsDialog = await importShowStatusOptionsDialog()
|
let showStatusOptionsDialog = await importShowStatusOptionsDialog()
|
||||||
|
|
|
@ -28,9 +28,10 @@ function onEvent (e) {
|
||||||
return // ignore if the user is selecting text inside the clickable area
|
return // ignore if the user is selecting text inside the clickable area
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (callbacks[key](e)) { // callback returns true to indicate it has handled the action
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
callbacks[key](e)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue