add perf mark for clicking spoiler button

[skip ci]
This commit is contained in:
Nolan Lawson 2018-04-10 22:30:14 -07:00
parent d95de24df5
commit 9bfa2cf013
1 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,7 @@
<script> <script>
import { store } from '../../_store/store' import { store } from '../../_store/store'
import { registerClickDelegate, unregisterClickDelegate } from '../../_utils/delegate' import { registerClickDelegate, unregisterClickDelegate } from '../../_utils/delegate'
import { mark, stop } from '../../_utils/marks'
export default { export default {
oncreate() { oncreate() {
@ -56,11 +57,13 @@
methods: { methods: {
onClickSpoilerButton() { onClickSpoilerButton() {
requestAnimationFrame(() => { requestAnimationFrame(() => {
mark('clickSpoilerButton')
let uuid = this.get('uuid') let uuid = this.get('uuid')
let $spoilersShown = this.store.get('spoilersShown') let $spoilersShown = this.store.get('spoilersShown')
$spoilersShown[uuid] = !$spoilersShown[uuid] $spoilersShown[uuid] = !$spoilersShown[uuid]
this.store.set({'spoilersShown': $spoilersShown}) this.store.set({'spoilersShown': $spoilersShown})
this.fire('recalculateHeight') this.fire('recalculateHeight')
stop('clickSpoilerButton')
}) })
} }
} }