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

[BS3] fix #309 garbage shown on modal for remotes #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 9 additions & 7 deletions dist/ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ var Lightbox = (function ($) {
key: 'Default',

/**
Class properties:
_$element: null -> the <a> element currently being displayed
Class properties:
_$element: null -> the <a> element currently being displayed
_$modal: The bootstrap modal generated
_$modalDialog: The .modal-dialog
_$modalContent: The .modal-content
Expand All @@ -60,13 +60,13 @@ var Lightbox = (function ($) {
_$lightboxContainerTwo: Container of the second lightbox element
_$lightboxBody: First element in the container
_$modalArrows: The overlayed arrows container
_$galleryItems: Other <a>'s available for this gallery
_$galleryItems: Other <a>'s available for this gallery
_galleryName: Name of the current data('gallery') showing
_galleryIndex: The current index of the _$galleryItems being shown
_config: {} the options for the modal
_config: {} the options for the modal
_modalId: unique id for the current lightbox
_padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content
*/
*/

get: function get() {
return Default;
Expand Down Expand Up @@ -502,7 +502,7 @@ var Lightbox = (function ($) {
// local ajax can be loaded into the container itself
if (!disableExternalCheck && !this._isExternal(url)) {
$containerForElement.load(url, $.proxy(function () {
return _this3._$element.trigger('loaded.bs.modal');l;
return _this3._$element.trigger('loaded.bs.modal');
}));
} else {
$containerForElement.html('<iframe src="' + url + '" frameborder="0" allowfullscreen></iframe>');
Expand Down Expand Up @@ -670,7 +670,9 @@ var Lightbox = (function ($) {
config = config || {};
return this.each(function () {
var $this = $(_this5);
var _config = $.extend({}, Lightbox.Default, $this.data(), typeof config === 'object' && config);
var data = $this.data();
delete data.remote;
var _config = $.extend({}, Lightbox.Default, data, typeof config === 'object' && config);

new Lightbox(_this5, _config);
});
Expand Down
2 changes: 1 addition & 1 deletion dist/ekko-lightbox.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ekko-lightbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ekko-lightbox.min.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion ekko-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,12 @@ const Lightbox = (($) => {
config = config || {}
return this.each(() => {
let $this = $(this)
let data = $this.data()
delete data.remote
let _config = $.extend(
{},
Lightbox.Default,
$this.data(),
data,
typeof config === 'object' && config
)

Expand Down