Skip to content

Commit 90f3d89

Browse files
committed
refactor: Remove Velocity from Slide q-transition
1 parent 1adfa1d commit 90f3d89

File tree

12 files changed

+99
-49
lines changed

12 files changed

+99
-49
lines changed

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module.exports = {
88
browser: true
99
},
1010
globals: {
11-
'__THEME': true,
12-
'Velocity': true
11+
'__THEME': true
1312
},
1413
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
1514
extends: 'standard',

build/script.build.javascript.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ var
2929
},
3030
external = [
3131
'fastclick',
32-
'moment',
33-
'velocity-animate'
32+
'moment'
3433
],
3534
globals = {
3635
fastclick: 'FastClick',
37-
moment: 'moment',
38-
'velocity-animate': 'Velocity'
36+
moment: 'moment'
3937
},
4038
rollupConfig = {
4139
entry: 'src/index.js',

dev/components/components/scroll-fire.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div>
33
<div class="layout-padding">
4-
<p class="caption">Please scroll down to see the image and Scroll Fire being called with a nice Velocity effect.</p>
4+
<p class="caption">Please scroll down to see the image have a short bounce effect when being visible for first time.</p>
55
<p v-for="n in 6">{{loremipsum}}</p>
66

7-
<p class="caption">Scroll Fire below. Reload page to see the effect again.</p>
7+
<p class="caption">Scroll Fire below. Reload page to see the bounce effect again.</p>
88
<p class="text-center">
99
<img v-scroll-fire="bounceImage" src="~assets/quasar.jpg" style="width: 200px">
1010
</p>
@@ -22,9 +22,13 @@ export default {
2222
}
2323
},
2424
methods: {
25-
bounceImage (element) {
26-
Velocity(element, 'fadeOut', {duration: 1000})
27-
Velocity(element, 'fadeIn', {delay: 300, duration: 1000})
25+
bounceImage (el) {
26+
el.classList.add('animate-bounce')
27+
setTimeout(() => {
28+
if (document.body.contains(el)) {
29+
el.classList.remove('animate-bounce')
30+
}
31+
}, 2050)
2832
}
2933
}
3034
}

dev/components/other/vue-transitions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</p>
1717

1818
<q-transition name="slide">
19-
<p v-show="visible">
19+
<p v-show="visible" style="margin: 0">
2020
<img
2121
class="responsive"
2222
src="~assets/quasar.jpg"

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"stylus": "^0.54.5",
8787
"stylus-loader": "^2.1.1",
8888
"url-loader": "^0.5.7",
89-
"velocity-animate": "^1.2.3",
9089
"vue": "^2.1.6",
9190
"vue-loader": "^10.0.0",
9291
"vue-router": "^2.0.0",
@@ -100,7 +99,6 @@
10099
"peerDependencies": {
101100
"fastclick": "1.x",
102101
"moment": "2.x",
103-
"velocity-animate": "1.x",
104102
"vue": "^2.1.6"
105103
}
106104
}

src/index.es6.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import Velocity from 'velocity-animate'
2-
window.Velocity = Velocity
3-
41
import install from './vue-install'
52
import start from './start'
63
import standaloneInstall from './standalone-install'

src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import Velocity from 'velocity-animate'
2-
window.Velocity = Velocity
3-
41
import install from './vue-install'
52
import start from './start'
63
import standaloneInstall from './standalone-install'

src/utils/store.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,19 @@ export function add (name, el, ctx) {
88
if (!data[name]) {
99
data[name] = {}
1010
}
11-
else if (data[name][id]) {
12-
console.warn('Element store [add]: overwriting data')
13-
}
1411
data[name][id] = ctx
1512
}
1613

1714
export function get (name, el) {
1815
let id = el.dataset['__' + name]
1916
if (!id) {
20-
console.warn('Element store [get]: id not registered', name, el)
2117
return
2218
}
2319
if (!data[name]) {
24-
console.warn('Element store [get]: name not registered', name, el)
2520
return
2621
}
2722
let ctx = data[name][id]
2823
if (!ctx) {
29-
console.warn('Element store [get]: data not found for', name, ':', id, '->', el)
3024
return
3125
}
3226
return ctx
@@ -35,7 +29,6 @@ export function get (name, el) {
3529
export function remove (name, el) {
3630
let id = el.dataset['__' + name]
3731
if (!id) {
38-
console.warn('Element store [remove]: id not registered', name, el)
3932
return
4033
}
4134
if (data[name] && data[name][id]) {

src/vue-install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { install as eventsInstall } from './features/events'
33
import { install as toastInstall } from './components/toast/toast'
44
import { current as theme } from './features/theme'
55

6-
import Transition from './vue-transitions/transition'
6+
import Transition from './vue-transitions/index'
77

88
import dBackToTop from './vue-directives/back-to-top'
99
import dGoBack from './vue-directives/go-back'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import slide from './transition-slide'
1+
import slide from './slide-toggle'
22

33
let transitions = {slide}
44

@@ -20,7 +20,7 @@ export default {
2020
},
2121
render (h, context) {
2222
if (!transitions[context.props.name]) {
23-
throw new Error(`Quasar Transition ${context.props.name} is unnowkn.`)
23+
throw new Error(`Quasar Transition ${context.props.name} is unknown.`)
2424
}
2525
var data = {
2626
props: {

0 commit comments

Comments
 (0)