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

Commit

Permalink
5.1.1: fix bs4 header position
Browse files Browse the repository at this point in the history
BS4 alpha 6 reordered the header items.

fixes #235
  • Loading branch information
ashleydw committed Jan 30, 2017
1 parent 77c386f commit ffcc8d1
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 137 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ekko-lightbox",
"version": "5.1.0",
"version": "5.1.1",
"main": "./dist/ekko-lightbox.min.js",
"ignore": [
"**/.*",
Expand Down
122 changes: 2 additions & 120 deletions dist/ekko-lightbox.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions dist/ekko-lightbox.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*!
* Lightbox for Bootstrap by @ashleydw
* https://github.com/ashleydw/lightbox
*
* License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
*/
+function ($) {

'use strict';

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; }; })();
Expand Down Expand Up @@ -82,7 +90,12 @@ var Lightbox = (function ($) {
this._modalId = 'ekkoLightbox-' + Math.floor(Math.random() * 1000 + 1);
this._$element = $element instanceof jQuery ? $element : $($element);

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>';
this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;

var h4 = '<h4 class="modal-title">' + (this._config.title || "&nbsp;") + '</h4>';
var btn = '<button type="button" class="close" data-dismiss="modal" aria-label="' + this._config.strings.close + '"><span aria-hidden="true">&times;</span></button>';

var header = '<div class="modal-header"' + (this._config.title || this._config.alwaysShowClose ? '' : ' style="display:none"') + '>' + (this._isBootstrap3 ? btn + h4 : h4 + btn) + '</div>';
var footer = '<div class="modal-footer"' + (this._config.footer ? '' : ' style="display:none"') + '>' + (this._config.footer || "&nbsp;") + '</div>';
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>';
var dialog = '<div class="modal-dialog" role="document"><div class="modal-content">' + header + body + footer + '</div></div>';
Expand Down Expand Up @@ -563,11 +576,13 @@ var Lightbox = (function ($) {
this._$lightboxContainer.css('height', maxHeight);
this._$modalDialog.css('width', 'auto').css('maxWidth', width);

try {
if (!this._isBootstrap3) {
// v4 method is mistakenly protected
this._$modal.data('bs.modal')._handleUpdate();
} catch (e) {
this._$modal.data('bs.modal').handleUpdate();
var modal = this._$modal.data('bs.modal');
if (modal) modal._handleUpdate();
} else {
var modal = this._$modal.data('bs.modal');
if (modal) modal.handleUpdate();
}
return this;
}
Expand Down Expand Up @@ -599,3 +614,5 @@ var Lightbox = (function ($) {
return Lightbox;
})(jQuery);
//# sourceMappingURL=ekko-lightbox.js.map

}(jQuery);
2 changes: 1 addition & 1 deletion dist/ekko-lightbox.js.map

Large diffs are not rendered by default.

Loading

2 comments on commit ffcc8d1

@fizzvr
Copy link

@fizzvr fizzvr commented on ffcc8d1 Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🍻, Maybe you think about upgrade the packpage.json to the latest versions?

@luciuschoi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, footer text are aligned to right-sided. To solve this problem, some styles should be added and updated in the ekko-lightbox.less, line no. 67 as follows:

  .modal-title {
    line-height: 1.2em;
  }
  .modal-footer {
    justify-content: unset;
  }

And you can do "grunt" command and render assets again.

2017-01-31_08-36-30

Please sign in to comment.