Sha256: 2bd5cdb090fde7b4294bf33a17450e43270b26959c133b1982c7174ec04a9d10

Contents?: true

Size: 1005 Bytes

Versions: 5

Compression:

Stored size: 1005 Bytes

Contents

/**
 * Apply JavaScript enter/leave functions.
 *
 * @param {Element} el
 * @param {Number} direction - 1: enter, -1: leave
 * @param {Function} op - the actual DOM operation
 * @param {Object} data - target element's transition data
 * @param {Object} def - transition definition object
 * @param {Vue} vm - the owner vm of the element
 * @param {Function} [cb]
 */

module.exports = function (el, direction, op, data, def, vm, cb) {
  if (data.cancel) {
    data.cancel()
    data.cancel = null
  }
  if (direction > 0) { // enter
    if (def.beforeEnter) {
      def.beforeEnter.call(vm, el)
    }
    op()
    if (def.enter) {
      data.cancel = def.enter.call(vm, el, function () {
        data.cancel = null
        if (cb) cb()
      })
    } else if (cb) {
      cb()
    }
  } else { // leave
    if (def.leave) {
      data.cancel = def.leave.call(vm, el, function () {
        data.cancel = null
        op()
        if (cb) cb()
      })
    } else {
      op()
      if (cb) cb()
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fluentd-ui-0.3.13 vendor/assets/javascripts/bower/vue/src/transition/js.js
fluentd-ui-0.3.12 vendor/assets/javascripts/bower/vue/src/transition/js.js
fluentd-ui-0.3.11 vendor/assets/javascripts/bower/vue/src/transition/js.js
fluentd-ui-0.3.10 vendor/assets/javascripts/bower/vue/src/transition/js.js
fluentd-ui-0.3.9 vendor/assets/javascripts/bower/vue/src/transition/js.js