Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use heavier selector for select2 #1997

Merged
merged 1 commit into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
window.update_state = function (region, done) {
'use strict';

var country = $('span#' + region + 'country .select2').select2('val');
var country = $('span#' + region + 'country select.select2').select2('val');
var state_select = $('span#' + region + 'state select.select2');
var state_input = $('span#' + region + 'state input.state_name');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ $ ->
url: @href
success: (r) ->
($ '#images').html r
($ '.select2').select2()
($ 'select.select2').select2()
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/products/new.js.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$("#new_product_wrapper").html('<%= escape_javascript(render template: "spree/admin/products/new", formats: [:html], handlers: [:erb]) %>');
handle_date_picker_fields();
<% unless Rails.env.test? %>
$('.select2').select2();
$('select.select2').select2();
<% end %>
$("#table-filter").hide();
$("#admin_new_product").parent().hide();
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ $('#actions').append('<%= escape_javascript( render(partial: 'spree/admin/promot
$('#actions .no-objects-found').hide();
$(".variant_autocomplete").variantAutocomplete();
//enable select2 functions for recently added box
$('.type-select.select2').last().select2();
$('select.type-select.select2').last().select2();

initPromotionActions();


$('#<%= dom_id @promotion_action %>').hide();
$('#<%= dom_id @promotion_action %>').fadeIn();
new Spree.CalculatorEditView({el: $('#<%= dom_id @promotion_action %> .js-calculator-fields')});

Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<% content_for :head do %>
<%= javascript_tag do -%>
$(document).ready(function(){
$('span#country .select2').on('change', function() { update_state(''); });
$('span#country select.select2').on('change', function() { update_state(''); });
});
<% end -%>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@

<script>
$(function(){
$('.select2').select2();
$('select.select2').select2();
});
</script>
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/variants/new.js.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$(".js-content-below-tabs").html('<%= escape_javascript(render template: 'spree/admin/variants/new', formats: [:html], handlers: [:erb]) %>');
$(".js-content-below-tabs .select2").select2();
$(".js-content-below-tabs select.select2").select2();