Sha256: 1b975f4064fcde5823b049fea3baa6e0008f9d5e8250011aa1ce7f8d08e577b2

Contents?: true

Size: 921 Bytes

Versions: 3

Compression:

Stored size: 921 Bytes

Contents

/*
---
 
script: Form.js
 
description: A form widgets. Intended to be submitted.
 
license: Public domain (http://unlicense.org).

authors: Yaroslaff Fedin
 
requires:
  - LSD/LSD.Widget
  - LSD/LSD.Mixin.Submittable
  - LSD/LSD.Mixin.Fieldset
  - LSD/LSD.Mixin.Command

provides: 
  - LSD.Widget.Form
 
...
*/

LSD.Widget.Form = new Class({
  options: {
    tag: 'form',
    pseudos: Array.fast('form', 'fieldset', 'command', 'submittable'),
    events: {
      self: {
        build: function() {
          // novalidate html attribute disables internal form validation 
          // on form submission. Chrome and Safari will block form 
          // submission without any visual clues otherwise.
          if (this.element.get('tag') == 'form') this.element.setProperty('novalidate', true);
        }
      }
    }
  },

  getRequestURL: function() {
    return this.attributes.action || location.pathname;
  }
});

Version data entries

3 entries across 3 versions & 1 rubygems

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