Sha256: 5d481b84045660ed6c7c506606a9e420f4e0ae35d69f57fb5a808fc88ca3473d

Contents?: true

Size: 1.56 KB

Versions: 18

Compression:

Stored size: 1.56 KB

Contents

  // Optional Javascript callback class. You typically need to define this when you have data to submit, or special
  // event handling to bind to.
  // To hook this up you need to provide the `v-plugin` class and
  // data-plugin-callback='RandomFacts' on the element.
  class RandomFacts {
    // passed the DOM element that has the .v-plugin class on it.
    constructor(element) {
      // This is where you might pull data elements into your
      // component from the markup. Like so:
      // this.data = element.dataset.someDataICareAbout;
    }

    // Optional
    // Called before the component is submitted via post/put. Allows the component to add its key/value pairs to the
    // submitted data.
    // If you provide this you need to add the v-input class to your DOM element to get called.
    // Containers iterate their elements that have the v-input class defined on them and invoke the prepareSubmit
    // function for each.
    prepareSubmit(params) {
      // params is a key,value pair. Add name/value like so:
      // params.push(['some_name', 'some_value']);
    }

    // Optional
    // Called whenever a container is about to be submitted, before prepareSubmit.
    // returns true on success
    // returns on failure return an error object that can be processed by VErrors:
    //    { email: ["email must be filled", "email must be from your domain"] }
    //    { page:  ["must be filled"] }
    // Returning an error stops the submission.
    validate(formData) {
      return true;
    }

    // Optional
    // Clear's the control
    clear() {
    }
  }

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.11 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.10 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.9 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.8 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.7 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.6 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.5 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.1.2 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.4 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.3 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.2 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
coprl-3.0.0.beta.1 lib/coprl/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.1.0 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.0.3 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.0.2 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.0.1 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt
voom-presenters-2.0.0 lib/voom/presenters/generators/templates/plugin/views/assets/js/components/component.js.tt