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

Commit

Permalink
Updates for bs4 alpha 6
Browse files Browse the repository at this point in the history
fixes #234
  • Loading branch information
ashleydw committed Jan 28, 2017
1 parent 76e20e1 commit a5bde30
Show file tree
Hide file tree
Showing 7 changed files with 3,267 additions and 13 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ A lightbox module for Bootstrap that supports images, YouTube videos, and galler

See the github page for docs: http://ashleydw.github.io/lightbox

>= v5 is for Boostrap 4, for Bootstrap 3 use the v4: https://github.com/ashleydw/lightbox/releases/tag/v4.0.2
Contributing
----
Instead of modifying the /dist/*.js JavaScript files directly, you should instead modify the ekko-lightbox.js file and run the grunt task.
Expand Down
2 changes: 1 addition & 1 deletion dist/ekko-lightbox.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Lightbox = (($) => {

let header = `<div class="modal-header"${this._config.title || this._config.alwaysShowClose ? '' : ' style="display:none"'}><button type="button" class="close" data-dismiss="modal" aria-label="${this._config.strings.close}"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">${this._config.title || "&nbsp;"}</h4></div>`;
let footer = `<div class="modal-footer"${this._config.footer ? '' : ' style="display:none"'}>${this._config.footer || "&nbsp;"}</div>`;
let body = '<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in"></div><div class="ekko-lightbox-item fade"></div></div></div>'
let body = '<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>'
let dialog = `<div class="modal-dialog" role="document"><div class="modal-content">${header}${body}${footer}</div></div>`
$(this._config.doc.body).append(`<div id="${this._modalId}" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">${dialog}</div>`)

Expand Down Expand Up @@ -230,15 +230,15 @@ const Lightbox = (($) => {
$current = this._$lightboxBodyTwo
}

$current.removeClass('in')
$current.removeClass('in show')
setTimeout(() => {
if(!this._$lightboxBodyTwo.hasClass('in'))
this._$lightboxBodyTwo.empty()
if(!this._$lightboxBodyOne.hasClass('in'))
this._$lightboxBodyOne.empty()
}, 500)

$toUse.addClass('in')
$toUse.addClass('in show')
return $toUse
}

Expand Down Expand Up @@ -298,12 +298,12 @@ const Lightbox = (($) => {
show = show || false
if(show) {
this._$modalDialog.css('display', 'none')
this._$modal.removeClass('in')
this._$modal.removeClass('in show')
$('.modal-backdrop').append(this._config.loadingMessage)
}
else {
this._$modalDialog.css('display', 'block')
this._$modal.addClass('in')
this._$modal.addClass('in show')
$('.modal-backdrop').find('.ekko-lightbox-loader').remove()
}
return this;
Expand Down Expand Up @@ -559,10 +559,10 @@ const Lightbox = (($) => {
this._$modalDialog.css('width', 'auto') .css('maxWidth', width);

try{
this._$modal.modal('_handleUpdate');
// v4 method is mistakenly protected
this._$modal.data('bs.modal')._handleUpdate();
}
catch(e){
// backward compatibility for bootstrap v3
this._$modal.data('bs.modal').handleUpdate();
}
return this;
Expand Down
Loading

0 comments on commit a5bde30

Please sign in to comment.