vendor/assets/javascripts/base/_hoverdown.js in active_frontend-17.6.3 vs vendor/assets/javascripts/base/_hoverdown.js in active_frontend-17.7.0
- old
+ new
@@ -113,20 +113,29 @@
};
// HOVERDOWN DATA-API
// ==================
- $(document).on('ready.bs.hoverdown.data-api', function () {
- $('[data-hover="dropdown"]').each(function () {
- var $this = $(this);
- if ($this.data('hoverdown')) return;
- Plugin.call($this, $this.data());
- });
- }).on('DOMCharacterDataModified.bs.hoverdown.data-api DOMSubtreeModified.bs.hoverdown.data-api DOMNodeInserted.bs.hoverdown.data-api', function () {
- $('[data-hover="dropdown"]').each(function () {
- var $this = $(this);
- if ($this.data('hoverdown')) return;
- Plugin.call($this, $this.data());
- });
+ function PluginCall(_this) {
+ var $this = $(_this);
+ if ($this.data('hoverdown')) return;
+ Plugin.call($this, $this.data());
+ }
+
+ if ($.fn.initialize) {
+ $.initialize('[data-hover="dropdown"]', function() {
+ PluginCall(this);
});
+ } else {
+ $(document)
+ .on('ready.bs.hoverdown.data-api', function () {
+ $('[data-hover="dropdown"]').each(function () {
+ PluginCall(this);
+ });
+ }).on('DOMCharacterDataModified.bs.hoverdown.data-api DOMSubtreeModified.bs.hoverdown.data-api DOMNodeInserted.bs.hoverdown.data-api', function () {
+ $('[data-hover="dropdown"]').each(function () {
+ PluginCall(this);
+ });
+ });
+ }
}(jQuery);