Skip to content

Commit

Permalink
Merge pull request #3 from djeglin/patch/ie-11-fix
Browse files Browse the repository at this point in the history
update src file with more universally accepted method syntax
  • Loading branch information
djeglin committed Oct 11, 2018
2 parents 30e899d + 17d6b2c commit 39a91d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Transition reflow in response to vue data changes.",
"scripts": {
"build": "webpack",
"prepublish": "npm run build"
"prepublish": "npm run build",
"postinstall": "npm run build"
},
"repository": {
"type": "git",
Expand Down
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@

const mixin = {
methods: {
$smoothReflow(options) {
$smoothReflow: function(options) {
let _registerElement = registerElement.bind(this)
if (Array.isArray(options))
options.forEach(_registerElement)
else
_registerElement(options)
},
$unsmoothReflow(options) {
$unsmoothReflow: function(options) {
let _unregisterElement = unregisterElement.bind(this)
if (Array.isArray(options))
options.forEach(_unregisterElement)
else
_unregisterElement(options)
},
},
beforeMount() {
beforeMount: function() {
this._smoothElements = []

this._endListener = event => {
Expand All @@ -34,13 +34,13 @@ const mixin = {
}
}
},
mounted() {
mounted: function() {
this.$el.addEventListener('transitionend', this._endListener, { passive: true })
},
destroyed() {
destroyed: function() {
this.$el.removeEventListener('transitionend', this._endListener, { passive: true })
},
beforeUpdate() {
beforeUpdate: function() {
// The component $el can be null during mounted, if it's hidden by a falsy v-if
// Duplicate event listeners are ignored, so it's safe to add this listener multiple times.
this.$el.addEventListener('transitionend', this._endListener, { passive: true })
Expand All @@ -53,7 +53,7 @@ const mixin = {
smoothEl.setBeforeValues()
}
},
updated() {
updated: function() {
this.$nextTick(() => {
// Retrieve component element on demand
// It could have been hidden by v-if/v-show
Expand Down

0 comments on commit 39a91d6

Please sign in to comment.