assigns_has_many_through_relations 0.0.9 → 0.0.10

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
  SHA1:
3
- metadata.gz: 06bf8f6e96a805f6379f9ee9c539fec4e6bcb967
4
- data.tar.gz: 618936e1c6b2bff1bc0f159275084b24be422dca
3
+ metadata.gz: 092f8749afaf41771b1037283b22a276959921de
4
+ data.tar.gz: 4151f38186dde4713cc49cbfe974c96bab710fa5
5
5
  SHA512:
6
- metadata.gz: 8a941e67cfeaa07242213c8d7d0313439806808ee9d3ab3b8a10d0c9e11ecfe7c7afb8d262bb399f0503637de3a63aa56b0cd04099ea16ecea1255a2747b9f2c
7
- data.tar.gz: ee130f468c58278016d05b27f7d73248ea5e314bdb9b85ba031ea8ac97bc48cb5c810930892ee450b10c94f37833b81f2a5fc183a86daf97956ae7517e98cc16
6
+ metadata.gz: 618562567e30b44b779fce34017256df0e80d1c58eba4950522aa9b442569b470e70184e10ae9502c67fde4c57bf6528102b72ca7a55b42ecc4e6ab86deec27d
7
+ data.tar.gz: 4d79ec58e1736efeeddb7b46704aa2fbd5083e730727c92f0b7ae99200856ab7f61d1a78342cff39945ce6ab565cb9473550b76faca8c971d28522b168c86b81
@@ -61,10 +61,12 @@ $(function() {
61
61
  $('.check-all-boxes').click(function(e) {
62
62
  e.preventDefault();
63
63
 
64
- var target = this.dataset.target,
65
- checkMe = $(target);
64
+ if (confirm(this.dataset.confirmText)) {
65
+ var target = this.dataset.target,
66
+ checkMe = $(target);
66
67
 
67
- checkMe.attr('checked', true);
68
- $(this).parents('form').submit();
68
+ checkMe.attr('checked', true);
69
+ $(this).parents('form').submit();
70
+ }
69
71
  })
70
72
  });
@@ -73,8 +73,8 @@
73
73
  </div>
74
74
 
75
75
  <div class="panel-footer">
76
- <%= f.submit 'Unassign Selected', class: 'btn btn-primary btn-xs' %>
77
- <%= f.submit 'Unassign All', class: 'btn btn-primary btn-xs check-all-boxes', data: { target: '#selected-right-side :checkbox', confirm: "Are you sure you want to Unassign all Users from the \"#{@selected_left_side_model.name}\" #{@selected_left_side_model.class}?" } %>
76
+ <%= f.submit 'Unassign Selected', class: 'btn btn-primary btn-xs', disabled: @selected_right_side_models.empty? %>
77
+ <%= f.submit 'Unassign All', class: 'btn btn-primary btn-xs check-all-boxes', data: { target: '#selected-right-side :checkbox', confirm_text: "Are you sure you want to Unassign all Users from the \"#{@selected_left_side_model.name}\" #{@selected_left_side_model.class}?" }, disabled: @selected_right_side_models.empty? %>
78
78
  </div>
79
79
  </div>
80
80
  </div>
@@ -105,8 +105,8 @@
105
105
  </div>
106
106
 
107
107
  <div class="panel-footer">
108
- <%= f.submit 'Assign Selected', class: 'btn btn-primary btn-xs' %>
109
- <%= f.submit 'Assign All', class: 'btn btn-primary btn-xs check-all-boxes', data: { target: '#available-right-side :checkbox', confirm: "Are you sure you want to Assign all Users to the \"#{@selected_left_side_model.name}\" #{@selected_left_side_model.class}?" } %>
108
+ <%= f.submit 'Assign Selected', class: 'btn btn-primary btn-xs', disabled: @available_right_side_models.empty? %>
109
+ <%= f.submit 'Assign All', class: 'btn btn-primary btn-xs check-all-boxes', data: { target: '#available-right-side :checkbox', confirm_text: "Are you sure you want to Assign all Users to the \"#{@selected_left_side_model.name}\" #{@selected_left_side_model.class}?" }, disabled: @available_right_side_models.empty? %>
110
110
  </div>
111
111
  </div>
112
112
  </div>
@@ -1,3 +1,3 @@
1
1
  module AssignsHasManyThroughRelations
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assigns_has_many_through_relations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Salazar