var App_Product_View = qs.createObject(); App_Product_View.prototype = { initialize: function (options) { this.options = $.extend(true, { imageContainer: undefined, image: { width: undefined, height: undefined } }, options); this.imageContainer = $('#' + this.options.imageContainer); this.slider = null; this.initSlider(); return this; }, initSlider: function () { var imageCfg = this.options.image; this.imageContainer.css('display', 'block'); this.slider = this.imageContainer.royalSlider({ globalCaption: true, globalCaptionInside: true, numImagesToPreload: 2, fadeinLoadedSlide: false, //imageAlignCenter: true, imageScaleMode: 'fit-if-smaller', imageScalePadding: 0, transitionType:'move', autoScaleSlider: true, // autoScaleSliderWidth: imageCfg.width, autoScaleSliderHeight: imageCfg.height, loop: true, arrowsNav: false, arrowsNavAutoHide: true, arrowsNavHideOnTouch: true, navigateByClick: false, keyboardNavEnabled: false, controlNavigation: 'thumbnails', thumbs: { orientation: 'horizontal', navigation: false, fitInViewport: false, autoCenter: false, spacing: 10 }, fullscreen: { enabled: true, nativeFS: true, buttonFS: true } }).data('royalSlider'); return this; }, initAdditionalImages: function () { if ($('#' + this._imageContainerId).size()) { var imageCount = $('#' + this._imageContainerId).children().size(); Galleria.loadTheme('js/galleria/classic/galleria.classic.js'); Galleria.configure({ showImagenav: (imageCount > 1), thumbnails: (imageCount > 1), debug: false, responsive: true, imageCrop: false, lightbox: true }); Galleria.run('#' + this._imageContainerId); } } }; var App_Product_View_AddItem = { _tooltipTimeout: 3000, onSuccessCallback: function(formId) { var response = Qs_Form.getFormOption(formId, 'response'); if (response.success === false) { alert('Error while add item to cart'); } else { var messageType = ''; if (response.success.type == 'message') { messageType = 'info'; } else { messageType = 'error'; } var btnSubmit = $('#' + formId + ' #btnSubmit'); btnSubmit.tooltip({title: response.success.message, placement: 'top', trigger: 'manual', html: true}); var tooltipTemplate = btnSubmit.data('tooltip').options.template.replace('class="tooltip"', 'class="tooltip tooltip-' + messageType + '"'); btnSubmit.data('tooltip').options.template = tooltipTemplate; btnSubmit.tooltip('show'); setTimeout(function () { btnSubmit.tooltip('destroy'); }, this._tooltipTimeout); if (typeof App_Cart_Small != 'undefined') { App_Cart_Small.reset(); App_Cart_Small.updateQty(response.success.quantity); } } } };