Sha256: cc69229f39c68146dd60378f9d5baeb5f1f7b65c9be99beca9c042e42d9146d7

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

/*
---
 
script: Submit.js
 
description: A button that submits form
 
license: Public domain (http://unlicense.org).

authors: Yaroslaff Fedin
 
requires:
  - LSD.Widget.Input
  - LSD.Widget.Button

provides: 
  - LSD.Widget.Input.Submit
  - LSD.Widget.Button.Submit
 
...
*/

LSD.Widget.Button.Submit = new Class({
  Implements: LSD.Widget.Button,
  
  options: {
    events: {
      _submission: {
        self: {
          setDocument: function() {
            var tag = this.element.get('tag');
            if (!tag || tag == 'input' || tag == 'button') return;
            this.shim = this.allocate('submit').inject(this.element);
            this.element.addEvent('destroy', this.shim.destroy.bind(this.shim));
          }
        }
      }
    },
    chain: {
      submission: function() {
        var target = this.form || Slick.find(this, '! :submittable');
        if (target) return {action: 'submit', target: target};
      }
    },
    pseudos: Array.fast('form-associated', 'value', 'command')
  }
});

LSD.Widget.Input.Submit = new Class({
  Implements: LSD.Widget.Button.Submit, 
  
  options: {
    tag: 'input'
  }
})

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lsd_rails-0.1.2 Packages/lsd-widgets/Source/Input/Submit.js
lsd_rails-0.1.1 Packages/lsd-widgets/Source/Input/Submit.js
lsd_rails-0.1 Packages/lsd-widgets/Source/Input/Submit.js