Closed sysout closed 10 years ago
You've probably run into a similar problem as what we found with the time picker. The problem is that the code which turns the <div class="bfh-timepicker">
into the real thing only runs when the page loads. If you add it in later via AJAX or something like that, it won't get transformed. We solved it by adding the following after adding the elements into the DOM (where element
is the part of the DOM we added into):
if ($.fn.bfhtimepicker) {
element.find('div.bfh-timepicker').each(function() {
var $timepicker = $(this);
$timepicker.bfhtimepicker($timepicker.data());
});
}
You'd have to modify this to work with the country and phone inputs of course (you can look at the BFH source to see what exactly you need to write)
I don't know anything about turbolinks, but it might offer some event that you can listen for, or hook that you can register for, so that you can run this code when turbolinks prefetches pages (I presume this is what turbolinks does?)
Actually, there is apparently a jquery-turbolinks gem which should fix this for you.
Thank you very much!
For example, I have to refresh the page to make country & phone select works. Temporary solution: Disable turbolinks in rails 4.