Sha256: b6bc377d8e8d42807792a3f05ae7750e7b3e8504f9649db1d8fdab385596b41f

Contents?: true

Size: 1.04 KB

Versions: 30

Compression:

Stored size: 1.04 KB

Contents

(function(prototype) {
  if (typeof prototype.requestSubmit == "function")
    return;
  prototype.requestSubmit = function(submitter) {
    if (submitter) {
      validateSubmitter(submitter, this);
      submitter.click();
    } else {
      submitter = document.createElement("input");
      submitter.type = "submit";
      submitter.hidden = true;
      this.appendChild(submitter);
      submitter.click();
      this.removeChild(submitter);
    }
  };
  function validateSubmitter(submitter, form) {
    submitter instanceof HTMLElement || raise(TypeError, "parameter 1 is not of type 'HTMLElement'");
    submitter.type == "submit" || raise(TypeError, "The specified element is not a submit button");
    submitter.form == form || raise(DOMException, "The specified element is not owned by this form element", "NotFoundError");
  }
  function raise(errorConstructor, message, name) {
    throw new errorConstructor("Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".", name);
  }
})(HTMLFormElement.prototype);
export default null;

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
spina-2.18.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.17.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.16.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.15.1 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.15.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.14.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.13.1 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.13.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.12.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.11.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.10.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.9.1 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.9.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.8.1 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.8.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.7.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.6.2 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.6.1 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.6.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js
spina-2.5.0 app/assets/javascripts/spina/libraries/form-request-submit-polyfill@2.0.0.js