Sha256: ae8d54141f6cae93cd35eb01206e37f970e31cf7f6818d456b79492fe1ee31b7

Contents?: true

Size: 585 Bytes

Versions: 5

Compression:

Stored size: 585 Bytes

Contents

// xlink
var xlinkNS = 'http://www.w3.org/1999/xlink'
var xlinkRE = /^xlink:/

module.exports = {

  priority: 850,

  bind: function () {
    var name = this.arg
    this.update = xlinkRE.test(name)
      ? xlinkHandler
      : defaultHandler
  }

}

function defaultHandler (value) {
  if (value || value === 0) {
    this.el.setAttribute(this.arg, value)
  } else {
    this.el.removeAttribute(this.arg)
  }
}

function xlinkHandler (value) {
  if (value != null) {
    this.el.setAttributeNS(xlinkNS, this.arg, value)
  } else {
    this.el.removeAttributeNS(xlinkNS, 'href')
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

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