Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

NoConflict and binding to Bootstrap data-api #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions dist/ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
}
};

//Save a possible conflicting lightbox
var old = $.fn.ekkoLightbox;
$.fn.ekkoLightbox = function(options) {
return this.each(function() {
var $this;
Expand Down Expand Up @@ -437,4 +439,20 @@ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
onContentLoaded: function() {}
};

$.fn.ekkoLightbox.Constructor = EkkoLightbox;

// MODAL DATA-API
// ==============
$(document).on('click.bs.ekkoLightbox.data-api', '[data-toggle="lightbox"]', function (e) {
event.preventDefault();
$(this).ekkoLightbox();
});

// MODAL NO CONFLICT
// =================
$.fn.ekkoLightbox.noConflict = function () {
$.fn.ekkoLightbox = old;
return this;
}

}).call(this);