zutils 0.2.9 → 0.3.0

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: bf846e9c312ebccb7cdbaef9c3c176c7e3d1dee47a79f080a95a6fdc8bfc6844
4
- data.tar.gz: 99f5a3df431d93b9bc81ed1e7c8a3cd1d6395dffe4045e6716f7401a3a2c8b91
3
+ metadata.gz: 1d42c0ca73acc3b60f21f106ccfb6804837fd6c0e6b258d40a4af40368eeeeb5
4
+ data.tar.gz: deeceb71569ee50e98da90961156861495dcc00ed980b5203e11702b9ca71d1b
5
5
  SHA512:
6
- metadata.gz: 0e0bd646795a8ac367228f3fc598e0a9b60c705b5fae90677d2d268493e45cf28caaed403c6904418d4a40f998e5879d788ff148ca5613f94baa6da2a41dd6f7
7
- data.tar.gz: fb0f5bc28a532aebbf58bf4f7f12f354827dcb9b11d4bb6dbd8db9aa4f8c6dcdfbd230d6485d99a9268649eb35f785c71be745b683c987149a42339aecdc7959
6
+ metadata.gz: fc216d04eea9dd9998e4097f6559235e1d51ca68fcefd991e24a189b669b839cd9bd8da399b5caa11d6603ce367dead9af8697baddd312e0c1a0a418a20140bf
7
+ data.tar.gz: 99e17283c693805e48c7d907d9dffda992475b257a1600bed2c0861d107364d9e94bef11ff83ff6fa25a0bdb57fc124b817096a4dfd584ead750d952c91bea23
data/.gitignore CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
@@ -8,26 +8,26 @@ $(document).ready(function () {
8
8
  create: function(input, callback) {
9
9
  selectizeCallback = callback;
10
10
 
11
- $("." + $(item).data('model') + "-modal").modal();
12
- $("#" + $(item).data('model') + "_name").val(input);
11
+ $("." + $(item).data('name') + "-modal").modal();
12
+ $("#" + $(item).data('name') + "_cpf").val(input);
13
13
  }
14
14
  });
15
15
 
16
- $("." + $(item).data('model') + "-modal").on("hide.bs.modal", function(e) {
16
+ $("." + $(item).data('name') + "-modal").on("hide.bs.modal", function(e) {
17
17
  if (selectizeCallback != null) {
18
18
  selectizeCallback();
19
19
  selecitzeCallback = null;
20
20
  }
21
21
 
22
- $("#new_" + $(item).data('model') + "").trigger("reset");
23
- $("#new_" + $(item).data('model') + " select").val(null).trigger('change');
24
- $.rails.enableFormElements($("#new_" + $(item).data('model') + ""));
22
+ $("." + $(item).data('name') + "-modal form").trigger("reset");
23
+ $("." + $(item).data('name') + "-modal form select").val(null).trigger('change');
24
+ $.rails.enableFormElements($("." + $(item).data('name') + "-modal form"));
25
25
  });
26
26
 
27
- $("#new_" + $(item).data('model')).on("submit", function(e) {
27
+ $("." + $(item).data('name') + "-modal form").on("submit", function(e) {
28
28
  e.preventDefault();
29
- $("#new_" + $(item).data('model')).find('.has-error').removeClass('has-error');
30
- $("#new_" + $(item).data('model')).find('.help-block').text("");
29
+ $("." + $(item).data('name') + "-modal form").find('.has-error').removeClass('has-error');
30
+ $("." + $(item).data('name') + "-modal form").find('.help-block').text("");
31
31
  $.ajax({
32
32
  method: "POST",
33
33
  dataType: "json",
@@ -37,17 +37,17 @@ $(document).ready(function () {
37
37
  selectizeCallback({value: response.id, text: response.name});
38
38
  selectizeCallback = null;
39
39
 
40
- $("." + $(item).data('model') + "-modal").modal('toggle');
40
+ $("." + $(item).data('name') + "-modal").modal('toggle');
41
41
  },
42
42
  error: function(response) {
43
43
  $.each(response.responseJSON, function(key, value) {
44
- $("#new_" + $(item).data('model')).find("." + $(item).data('model') + '_' + key).addClass('has-error');
45
- if (!($("#new_" + $(item).data('model') + " ." + $(item).data('model') + '_' + key).find('.help-block').length)) {
46
- $("#new_" + $(item).data('model')).find("." + $(item).data('model') + '_' + key).append("<p class='help-block'></p>");
44
+ $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).addClass('has-error');
45
+ if (!($("." + $(item).data('name') + "-modal form" + " ." + $(item).data('model') + '_' + key).find('.help-block').length)) {
46
+ $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).append("<p class='help-block'></p>");
47
47
  }
48
- $("#new_" + $(item).data('model')).find("." + $(item).data('model') + '_' + key).find('.help-block').text(value);
48
+ $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).find('.help-block').text(value);
49
49
  });
50
- $.rails.enableFormElements($("#new_" + $(item).data('model') + ""));
50
+ $.rails.enableFormElements($("." + $(item).data('name') + "-modal form" + ""));
51
51
  }
52
52
  });
53
53
  });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  <% partial ||= 'shared/fields' %>
2
+ <% name ||= object.model_name.singular %>
2
3
 
3
- <div class="modal fade in <%= object.model_name.singular %>-modal" id="modal-default">
4
+ <div class="modal fade in <%= name %>-modal" id="modal-default">
4
5
  <div class="modal-dialog">
5
6
  <div class="modal-content">
6
7
  <div class="modal-header">
File without changes
data/bin/console CHANGED
File without changes
data/bin/setup CHANGED
File without changes
data/lib/zutils/engine.rb CHANGED
File without changes
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/zutils.rb CHANGED
File without changes
data/zutils.gemspec CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-13 00:00:00.000000000 Z
11
+ date: 2019-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails