Aquarius.component.define('Widgets/Fslightbox', function ($element, options) { var defaults = {}; function Fslightbox() { } Fslightbox.prototype = { init: function () { var self = this; this.options = Aquarius.extend(defaults, options); this.$element = $element; this.$button = this.$element.find('button'); this.initElement(); }, initElement: function () { var self = this; this.$button.off('click').on('click', function () { fsLightboxInstances[$(this).attr('data-gallery-id')].open(0); }) } }; return new Fslightbox; });