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

Commit a5bde30

Browse files
committed
Updates for bs4 alpha 6
fixes #234
1 parent 76e20e1 commit a5bde30

File tree

7 files changed

+3267
-13
lines changed

7 files changed

+3267
-13
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ A lightbox module for Bootstrap that supports images, YouTube videos, and galler
55

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

8-
>= v5 is for Boostrap 4, for Bootstrap 3 use the v4: https://github.com/ashleydw/lightbox/releases/tag/v4.0.2
9-
108
Contributing
119
----
1210
Instead of modifying the /dist/*.js JavaScript files directly, you should instead modify the ekko-lightbox.js file and run the grunt task.

dist/ekko-lightbox.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ekko-lightbox.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Lightbox = (($) => {
7474

7575
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>`;
7676
let footer = `<div class="modal-footer"${this._config.footer ? '' : ' style="display:none"'}>${this._config.footer || "&nbsp;"}</div>`;
77-
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>'
77+
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>'
7878
let dialog = `<div class="modal-dialog" role="document"><div class="modal-content">${header}${body}${footer}</div></div>`
7979
$(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>`)
8080

@@ -230,15 +230,15 @@ const Lightbox = (($) => {
230230
$current = this._$lightboxBodyTwo
231231
}
232232

233-
$current.removeClass('in')
233+
$current.removeClass('in show')
234234
setTimeout(() => {
235235
if(!this._$lightboxBodyTwo.hasClass('in'))
236236
this._$lightboxBodyTwo.empty()
237237
if(!this._$lightboxBodyOne.hasClass('in'))
238238
this._$lightboxBodyOne.empty()
239239
}, 500)
240240

241-
$toUse.addClass('in')
241+
$toUse.addClass('in show')
242242
return $toUse
243243
}
244244

@@ -298,12 +298,12 @@ const Lightbox = (($) => {
298298
show = show || false
299299
if(show) {
300300
this._$modalDialog.css('display', 'none')
301-
this._$modal.removeClass('in')
301+
this._$modal.removeClass('in show')
302302
$('.modal-backdrop').append(this._config.loadingMessage)
303303
}
304304
else {
305305
this._$modalDialog.css('display', 'block')
306-
this._$modal.addClass('in')
306+
this._$modal.addClass('in show')
307307
$('.modal-backdrop').find('.ekko-lightbox-loader').remove()
308308
}
309309
return this;
@@ -559,10 +559,10 @@ const Lightbox = (($) => {
559559
this._$modalDialog.css('width', 'auto') .css('maxWidth', width);
560560

561561
try{
562-
this._$modal.modal('_handleUpdate');
562+
// v4 method is mistakenly protected
563+
this._$modal.data('bs.modal')._handleUpdate();
563564
}
564565
catch(e){
565-
// backward compatibility for bootstrap v3
566566
this._$modal.data('bs.modal').handleUpdate();
567567
}
568568
return this;

0 commit comments

Comments
 (0)