From f5b09e54f40a42ddf0a94af5ccb0e8c7ff003882 Mon Sep 17 00:00:00 2001 From: Joel Low Date: Tue, 23 Feb 2016 08:37:03 +0800 Subject: [PATCH] Fix compatibility layer when bootstrap-select-rails is not installed. --- CHANGELOG.md | 1 + app/assets/javascripts/simple_form-bootstrap.js | 1 + app/assets/javascripts/simple_form-bootstrap/select_input.js | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d087e11..d65e307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### bug fixes * Do not change selects to the Bootstrap select class unless they are explicitly select fields. Other types of controls also give select fields -- typeaheads and the like. + * Fix compatibility layer for Bootstrap selects when the `bootstrap-select-rails` is not installed. ## 1.2.0 diff --git a/app/assets/javascripts/simple_form-bootstrap.js b/app/assets/javascripts/simple_form-bootstrap.js index df90eb0..99d02d2 100644 --- a/app/assets/javascripts/simple_form-bootstrap.js +++ b/app/assets/javascripts/simple_form-bootstrap.js @@ -1,4 +1,5 @@ //= require simple_form-bootstrap/date_time_input +//= require simple_form-bootstrap/select_input //= require simple_form-bootstrap/token_input (function($) { diff --git a/app/assets/javascripts/simple_form-bootstrap/select_input.js b/app/assets/javascripts/simple_form-bootstrap/select_input.js index 987e65e..c4c6a0b 100644 --- a/app/assets/javascripts/simple_form-bootstrap/select_input.js +++ b/app/assets/javascripts/simple_form-bootstrap/select_input.js @@ -6,7 +6,7 @@ return; } - $.fn.selectpicker = function(arg) { - return methods.initialise.call(this, arg); + $.fn.selectpicker = function() { + return this; }; }(jQuery));