cm-admin 1.0.5 → 1.0.6

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: faecf51ddd1a7dd895ec281a4beb4b4a88e8efe63918b41cac512f72ec27c460
4
- data.tar.gz: d1e94c3ec4bc95e8bc4bc3a42572d62606019dec522cc172135e2201ccd63f63
3
+ metadata.gz: 86d033fefa5d556af30d7127b65993513423c82a5358774eba875ab17d8946a1
4
+ data.tar.gz: 466f4769e70f2d6133873d5931cb4d6fbf826629b8ad3b837ff06b5fe36c49ca
5
5
  SHA512:
6
- metadata.gz: 93f0cc6ef4e82a7aa47c776fcf1bc4ce9eba0f3f728eac78c9ee6f28d6cf887e8189cdb800bf67af8aa85a93ce0ace51d36cc65f243e0e946f59f061cf97656d
7
- data.tar.gz: 9472785aa3b6c2648be151f9d188d2084748cd35fbdadab91a9d53045eea06129bb09ec3e28e63ba371829988c0307720821862d467d9d008d1056e6033300af
6
+ metadata.gz: 5d5f05bc6a9a5e02226c95e8a487210b391272e4d8bf871327fbc013359f9f4e25e50d0bb68b57c08607573e57fb92e142282f0176bb3e7ad5473047904f97c7
7
+ data.tar.gz: 0b6f062d86781a11903361f97bd2d3de607d500ff675b0ce1acebfbdb0548cd4842033d54066ba058aacd7f57ec6570383570ae5f6a7d1eb8e263884f0e6d535
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.0.5)
4
+ cm-admin (1.0.6)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -1,37 +1,36 @@
1
- $(document).on('turbolinks:load', function () {
2
- $(document).on('click', '.form_submit', function(e) {
3
- e.preventDefault();
4
- var submit = [];
5
- var form_class = $(this).data('form-class');
6
- $("." + form_class + " input.required, ." + form_class + " textarea.required").each(function() {
7
- $(this).removeClass('error');
8
- if ($(this).val().trim().length === 0) {
9
- $(this).addClass('error');
10
- window.scrollTo(top);
11
- submit.push(true);
12
- }
13
- });
14
- $("." + form_class + " select.required").each(function() {
15
- $(this).removeClass('error');
16
- if ($(this).val().trim().length === 0) {
17
- $(this).parent().find('.select2').addClass('error');
18
- window.scrollTo(top);
19
- submit.push(true);
20
- }
21
- });
22
- $('.nested_input_validation').each(function() {
23
- var class_name;
24
- class_name = $(this).data('class-name');
25
- $(this).parents(':nth(1)').find('.' + class_name).addClass('hidden');
26
- if ($(this).val().trim().length === 0) {
27
- $(this).parents(':nth(1)').find('.' + class_name).removeClass('hidden');
28
- window.scrollTo(top);
29
- submit.push(true);
30
- }
31
- });
32
- if (submit.length === 0) {
33
- $('.' + form_class).submit();
34
- return $('.form_submit').button('loading');
1
+ $(document).on('click', '.form_submit', function(e) {
2
+ console.log('Came here')
3
+ e.preventDefault();
4
+ var submit = [];
5
+ var form_class = $(this).data('form-class');
6
+ $("." + form_class + " input.required, ." + form_class + " textarea.required").each(function() {
7
+ $(this).removeClass('error');
8
+ if ($(this).val().trim().length === 0) {
9
+ $(this).addClass('error');
10
+ $(this)[0].scrollIntoView(true);
11
+ submit.push(true);
35
12
  }
36
13
  });
37
- });
14
+ $("." + form_class + " select.required").each(function() {
15
+ $(this).removeClass('error');
16
+ if ($(this).val().trim().length === 0) {
17
+ $(this).parent().find('.select2').addClass('error');
18
+ $(this)[0].scrollIntoView(true);
19
+ submit.push(true);
20
+ }
21
+ });
22
+ $('.nested_input_validation').each(function() {
23
+ var class_name;
24
+ class_name = $(this).data('class-name');
25
+ $(this).parents(':nth(1)').find('.' + class_name).addClass('hidden');
26
+ if ($(this).val().trim().length === 0) {
27
+ $(this).parents(':nth(1)').find('.' + class_name).removeClass('hidden');
28
+ $(this)[0].scrollIntoView(true);
29
+ submit.push(true);
30
+ }
31
+ });
32
+ if (submit.length === 0) {
33
+ $('.' + form_class).submit();
34
+ return $('.form_submit').button('loading');
35
+ }
36
+ });
@@ -22,7 +22,11 @@ $(document).on('click', '.row-action-cell', function(e) {
22
22
  $('.row-action-cell').removeClass('opacity-1')
23
23
  $(this).addClass('opacity-1');
24
24
  }
25
- $(this).find('.table-export-popup').toggle('hidden')
25
+ if ($(this).find('.table-export-popup').hasClass('hidden')) {
26
+ return $(this).find('.table-export-popup').removeClass('hidden');
27
+ } else {
28
+ return $(this).find('.table-export-popup').addClass('hidden');
29
+ }
26
30
  });
27
31
 
28
32
 
@@ -72,7 +72,7 @@ a {
72
72
  position: sticky;
73
73
  top: 0;
74
74
  background-color: $white;
75
- z-index: 4;
75
+ z-index: 5;
76
76
  }
77
77
 
78
78
  .scrollable {
@@ -8,7 +8,7 @@
8
8
  height: 100%;
9
9
  background-color: #252525;
10
10
  // overflow: hidden;
11
- z-index: 2;
11
+ z-index: 3;
12
12
 
13
13
  &__logo-header {
14
14
  display: flex;
@@ -34,7 +34,7 @@
34
34
  - if custom_action.display_if.call(ar_object)
35
35
  - case custom_action.display_type
36
36
  - when :button
37
- = link_to cm_admin.send("#{cm_model.name.underscore}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
37
+ = button_to cm_admin.send("#{cm_model.name.underscore}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
38
38
  .popup-option
39
39
  span
40
40
  i class="#{custom_action.icon_name}"
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end
@@ -73,9 +73,9 @@ module CmAdmin
73
73
 
74
74
  def custom_action_button(custom_action, current_action_name)
75
75
  if current_action_name == "index"
76
- link_to custom_action_title(custom_action), @model.ar_model.table_name + '/' + custom_action.path, class: 'secondary-btn ml-2', method: custom_action.verb
76
+ button_to custom_action_title(custom_action), @model.ar_model.table_name + '/' + custom_action.path, class: 'secondary-btn ml-2', method: custom_action.verb
77
77
  elsif current_action_name == "show"
78
- link_to custom_action_title(custom_action), custom_action.path.gsub(':id', params[:id]), class: 'secondary-btn ml-2', method: custom_action.verb
78
+ button_to custom_action_title(custom_action), custom_action.path.gsub(':id', params[:id]), class: 'secondary-btn ml-2', method: custom_action.verb
79
79
  end
80
80
  end
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-05-02 00:00:00.000000000 Z
13
+ date: 2023-05-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails