codice:
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define([
'jquery',
'./blueimp-gallery'
], factory);
} else {
factory(
window.jQuery,
window.blueimp.Gallery
);
}
}(function ($, Gallery) {
'use strict';
$.extend(Gallery.prototype.options, {
useBootstrapModal: true
});
var close = Gallery.prototype.close,
imageFactory = Gallery.prototype.imageFactory,
videoFactory = Gallery.prototype.videoFactory,
textFactory = Gallery.prototype.textFactory;
$.extend(Gallery.prototype, {
modalFactory: function (obj, callback, factoryInterface, factory) {
if (!this.options.useBootstrapModal || factoryInterface) {
return factory.call(this, obj, callback, factoryInterface);
}
var that = this,
modalTemplate = this.container.children('.modal'),
modal = modalTemplate.clone().show()
.on('click', function (event) {
// Close modal if click is outside of modal-content:
if (event.target === modal[0] ||
event.target === modal.children()[0]) {
event.preventDefault();
event.stopPropagation();
that.close();
}
}),
element = factory.call(this, obj, function (event) {
callback({
type: event.type,
target: modal[0]
});
modal.addClass('in');
}, factoryInterface);
modal.find('.modal-title').text(element.title || String.fromCharCode(160));
modal.find('.modal-body').append(element);
return modal[0];
},
imageFactory: function (obj, callback, factoryInterface) {
return this.modalFactory(obj, callback, factoryInterface, imageFactory);
},
videoFactory: function (obj, callback, factoryInterface) {
return this.modalFactory(obj, callback, factoryInterface, videoFactory);
},
textFactory: function (obj, callback, factoryInterface) {
return this.modalFactory(obj, callback, factoryInterface, textFactory);
},
close: function () {
this.container.find('.modal').removeClass('in');
close.call(this);
}
});
}));
function nomeFunzione(){
var borderless = $(this).is(':checked');
$('#blueimp-gallery').data('useBootstrapModal', !borderless);
$('#blueimp-gallery').toggleClass('blueimp-gallery-controls', borderless);
};
Non capisco il problema.