Skip to content

Commit

Permalink
Add ability to pass selector to set_taxon_select js-function
Browse files Browse the repository at this point in the history
  • Loading branch information
romul authored and Jeff Dutil committed Mar 8, 2015
1 parent 5af296e commit d97c55d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -1,8 +1,8 @@
'use strict';

var set_taxon_select = function(){
if ($('#product_taxon_ids').length > 0) {
$('#product_taxon_ids').select2({
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
Expand Down Expand Up @@ -47,5 +47,5 @@ var set_taxon_select = function(){
}

$(document).ready(function () {
set_taxon_select()
set_taxon_select('#product_taxon_ids')
});
Expand Up @@ -7,4 +7,4 @@ $('.user_picker').userAutocomplete();
$('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
$('#promotion_rule_type').select2();

set_taxon_select()
set_taxon_select('#product_taxon_ids')

0 comments on commit d97c55d

Please sign in to comment.