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

Commit ffcc8d1

Browse files
committed
5.1.1: fix bs4 header position
BS4 alpha 6 reordered the header items. fixes #235
1 parent 77c386f commit ffcc8d1

File tree

9 files changed

+44
-137
lines changed

9 files changed

+44
-137
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ekko-lightbox",
3-
"version": "5.1.0",
3+
"version": "5.1.1",
44
"main": "./dist/ekko-lightbox.min.js",
55
"ignore": [
66
"**/.*",

dist/ekko-lightbox.css

Lines changed: 2 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ekko-lightbox.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*!
2+
* Lightbox for Bootstrap by @ashleydw
3+
* https://github.com/ashleydw/lightbox
4+
*
5+
* License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
6+
*/
7+
+function ($) {
8+
19
'use strict';
210

311
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
@@ -82,7 +90,12 @@ var Lightbox = (function ($) {
8290
this._modalId = 'ekkoLightbox-' + Math.floor(Math.random() * 1000 + 1);
8391
this._$element = $element instanceof jQuery ? $element : $($element);
8492

85-
var 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>';
93+
this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;
94+
95+
var h4 = '<h4 class="modal-title">' + (this._config.title || "&nbsp;") + '</h4>';
96+
var btn = '<button type="button" class="close" data-dismiss="modal" aria-label="' + this._config.strings.close + '"><span aria-hidden="true">&times;</span></button>';
97+
98+
var header = '<div class="modal-header"' + (this._config.title || this._config.alwaysShowClose ? '' : ' style="display:none"') + '>' + (this._isBootstrap3 ? btn + h4 : h4 + btn) + '</div>';
8699
var footer = '<div class="modal-footer"' + (this._config.footer ? '' : ' style="display:none"') + '>' + (this._config.footer || "&nbsp;") + '</div>';
87100
var 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>';
88101
var dialog = '<div class="modal-dialog" role="document"><div class="modal-content">' + header + body + footer + '</div></div>';
@@ -563,11 +576,13 @@ var Lightbox = (function ($) {
563576
this._$lightboxContainer.css('height', maxHeight);
564577
this._$modalDialog.css('width', 'auto').css('maxWidth', width);
565578

566-
try {
579+
if (!this._isBootstrap3) {
567580
// v4 method is mistakenly protected
568-
this._$modal.data('bs.modal')._handleUpdate();
569-
} catch (e) {
570-
this._$modal.data('bs.modal').handleUpdate();
581+
var modal = this._$modal.data('bs.modal');
582+
if (modal) modal._handleUpdate();
583+
} else {
584+
var modal = this._$modal.data('bs.modal');
585+
if (modal) modal.handleUpdate();
571586
}
572587
return this;
573588
}
@@ -599,3 +614,5 @@ var Lightbox = (function ($) {
599614
return Lightbox;
600615
})(jQuery);
601616
//# sourceMappingURL=ekko-lightbox.js.map
617+
618+
}(jQuery);

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.

0 commit comments

Comments
 (0)