beyond_canvas 0.15.0.pre → 0.15.1.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d367f6132c52453a85ad880605b90ba30811ef32da9bc28dd1f685e8554c2e41
4
- data.tar.gz: 91a7c9f2f15564fe0752aeed2b682f938d595b82e48df9b1148e72dbe3429b98
3
+ metadata.gz: ef55151b505d03b5e940bbb09fa64b01bf267426fb5d2b20f25a74a0d4226534
4
+ data.tar.gz: b2430821affb163c1ffda7cf4611bc924e310cb21cb02d7ef461b88de594385c
5
5
  SHA512:
6
- metadata.gz: de56ea97d47081b565a4ba795ab8ee105ba9faf0ff6cbb6e42f852ef160b68804885714583c5d7c3090bdf720a80d53d6cc028664368a81abd1f5a8839d8df13
7
- data.tar.gz: 12cd7fb3261b4fce0f620cc8179ff160ed17f62f82eae55a67e6316986b90c842dcb4ed15c8c68a54108bd4e45ff5614da3d08918c994f204e6c8a98dd9078f8
6
+ metadata.gz: 6fcaa57a073215b62c451b5d325022384ad1a8c1a77ecefa50caf40481150ed1c43e18cc5e92478f19011b15929db3f5b665124c2438f2bcd78f7d48bda384aa
7
+ data.tar.gz: d8ab25f70ae9821cb23fab3be6f419f00be764281b02632d4527f0023ae2e711b32e8bbb04d3a322ab6affafc992d3b11b2d0d4a37c1f1e404bcbeea9d623d34
@@ -2,16 +2,28 @@
2
2
  * Warning: This file is auto-generated, do not modify. Instead, make your changes in 'app/javascript/beyond_canvas/' and run `yarn build`
3
3
  */
4
4
  //= require jquery3
5
- //= require jquery_ujs
6
5
  //= require_self
7
6
 
8
7
  (function(factory) {
9
- typeof define === "function" && define.amd ? define([ "jquery", "jquery-ujs" ], factory) : factory();
8
+ typeof define === "function" && define.amd ? define([ "jquery" ], factory) : factory();
10
9
  })(function() {
11
10
  "use strict";
12
11
  var SPINNER_ANIMATION_TIMEOUT = 125;
13
12
  (function($) {
14
13
  var onDOMReady = function onDOMReady() {
14
+ var inputs = $("input, textarea, select").not(":input[type=button], :input[type=submit], :input[type=reset]");
15
+ inputs.each(function() {
16
+ var input = $(this);
17
+ input.bind("invalid", function(e) {
18
+ if ($(input).is(":hidden")) {
19
+ e.preventDefault();
20
+ }
21
+ $('button[class^="button"]').each(function() {
22
+ hideSpinner($(this));
23
+ });
24
+ enableActionElements();
25
+ });
26
+ });
15
27
  $('button[class^="button"]').each(function() {
16
28
  var button = $(this);
17
29
  button.width(button.width());
@@ -30,7 +42,7 @@
30
42
  disableActionElements();
31
43
  showSpinner($(this));
32
44
  });
33
- $(document).ready(onDOMReady).on("ready page:load turbolinks:load", onDOMReady);
45
+ $(document).on("ready page:load turbolinks:load", onDOMReady);
34
46
  })(jQuery);
35
47
  function showSpinner(button) {
36
48
  button.width(button.width() + $(".spinner").outerWidth(true));
@@ -66,7 +78,7 @@
66
78
  $(document).on("click", ".flash", function() {
67
79
  closeAlert();
68
80
  });
69
- $(document).ready(onDOMReady).on("ready page:load turbolinks:load", onDOMReady);
81
+ $(document).on("ready page:load turbolinks:load", onDOMReady);
70
82
  })(jQuery);
71
83
  function closeAlert() {
72
84
  $(".flash").removeClass("flash--shown").delay(700).queue(function() {
@@ -89,6 +101,6 @@
89
101
  });
90
102
  });
91
103
  };
92
- $(document).ready(onDOMReady).on("ready page:load turbolinks:load", onDOMReady);
104
+ $(document).on("ready page:load turbolinks:load", onDOMReady);
93
105
  })(jQuery);
94
106
  });
@@ -1,6 +1,5 @@
1
- import 'jquery'
2
- import 'jquery-ujs'
1
+ import 'jquery';
3
2
 
4
- import './initializers/buttons'
5
- import './initializers/flash'
6
- import './initializers/inputs'
3
+ import './initializers/buttons';
4
+ import './initializers/flash';
5
+ import './initializers/inputs';
@@ -2,6 +2,22 @@ const SPINNER_ANIMATION_TIMEOUT = 125;
2
2
 
3
3
  (function($) {
4
4
  const onDOMReady = function () {
5
+ const inputs = $('input, textarea, select').not(':input[type=button], :input[type=submit], :input[type=reset]');
6
+
7
+ inputs.each(function () {
8
+ var input = $(this);
9
+
10
+ input.bind('invalid', function (e) {
11
+ if ($(input).is(':hidden')) {
12
+ e.preventDefault();
13
+ }
14
+ $('button[class^="button"]').each(function () {
15
+ hideSpinner($(this));
16
+ });
17
+ enableActionElements();
18
+ });
19
+ });
20
+
5
21
  $('button[class^="button"]').each(function () {
6
22
  var button = $(this);
7
23
 
@@ -32,13 +48,12 @@ const SPINNER_ANIMATION_TIMEOUT = 125;
32
48
  });
33
49
  };
34
50
 
35
- $(document).on('click', '[class^="button"]', function() {
51
+ $(document).on('click', '[class^="button"]', function () {
36
52
  disableActionElements();
37
53
  showSpinner($(this));
38
54
  });
39
55
 
40
56
  $(document)
41
- .ready(onDOMReady)
42
57
  .on('ready page:load turbolinks:load', onDOMReady);
43
58
  })(jQuery);
44
59
 
@@ -67,6 +82,6 @@ function disableActionElements() {
67
82
  }
68
83
  function enableActionElements() {
69
84
  $('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
70
- $(this).removeClass("actions--disabled");
85
+ $(this).removeClass('actions--disabled');
71
86
  });
72
87
  }
@@ -14,7 +14,6 @@
14
14
  });
15
15
 
16
16
  $(document)
17
- .ready(onDOMReady)
18
17
  .on('ready page:load turbolinks:load', onDOMReady);
19
18
  })(jQuery);
20
19
 
@@ -34,6 +34,5 @@
34
34
  };
35
35
 
36
36
  $(document)
37
- .ready(onDOMReady)
38
37
  .on('ready page:load turbolinks:load', onDOMReady);
39
38
  })(jQuery);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- VERSION = '0.15.0.pre'
4
+ VERSION = '0.15.1.pre'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0.pre
4
+ version: 0.15.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-25 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: beyond_api
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.0'
33
+ version: '5.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '7.0'
40
+ version: '5.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: colorize
43
43
  requirement: !ruby/object:Gem::Requirement