Sha256: 0cc539f68dc157593f5b86ab7c6ee81a3a9c79669e1c8cd71e9eb795723f1cd0

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

if (window.MooTools) {
  Element.implement({
    hasElement: function(tag){
      return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElement(tag) != null)
    },

    hasElements: function(tag){
      return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElements(tag).length > 1)
    },

    hasEvent: function(eventType, fn){
      var myEvents = this.retrieve('events')
      return myEvents && myEvents[eventType] && (fn == undefined || myEvents[eventType].keys.contains(fn))
    },

    hasParent: function(tag){
      return (tag == undefined) ? (this.getParent().length > 0) : (this.getParent(tag) != null)
    },

    disable: function(){
      this.set('disabled', true)
      return this
    },

    enable: function(){
      this.set('disabled', false)
      return this
    }
  })
}
else {
  if (console && console.error) console.error('Mootools is not yet installed.')
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mootools-plus-0.1.6 vendor/assets/javascripts/mootools-plus/element.js
mootools-plus-0.1.5 vendor/assets/javascripts/mootools-plus/element.js
mootools-plus-0.1.4 vendor/assets/javascripts/mootools-plus/element.js
mootools-plus-0.1.3 vendor/assets/javascripts/mootools-plus/element.js