PageSourceSearch

https://www.velozen.com/modules/configurator//views/js/front/modules/display/base_display.js

js velozen.com collected 2026-10-07 22:42:33 UTC 2,019 bytes, 56 lines download raw bytes

1/**
2 * 2023 DMConcept
3 *
4 * NOTICE OF LICENSE
5 *
6 * This file is licenced under the Software License Agreement.
7 * With the purchase or the installation of the software in your application
8 * you accept the licence agreement
9 *
10 * @author    DMConcept <[email protected]>
11 * @copyright 2023 DMConcept
12 * @license   Commercial license (You can not resell or redistribute this software.)
13 *
14 */
15
16var CONFIGURATOR = CONFIGURATOR || {};
17CONFIGURATOR.MODULES = CONFIGURATOR.MODULES || {};
18CONFIGURATOR.MODULES.DISPLAY = CONFIGURATOR.MODULES.DISPLAY || {};
19
20/**
21 * Base display module to handle the left panel (where images are displayed)
22 * @param params    Init parameter, specific to subclasses
23 * @param callback  Must be called after the module ended its initialisation
24 *                  Usefull when module needs to make async tasks
25 */
26CONFIGURATOR.MODULES.DISPLAY.BaseDisplay = function(params, callback) {
27    
28    this.canStartScroll = function() {
29        var WinHelper = CONFIGURATOR.WindowHelper;
30        return !WinHelper.isMobile() && !this.params.contentOnly;
31    };
32
33    this.initScroll = function() {
34        var self = this;
35        this.scroll = new CONFIGURATOR.ScrollFix($);
36        this.scroll.init(self.params.element, {
37            marginTop: 35,
38            removeOffsets: true,
39            limit: function() {
40                    return $('.page-product-box').first().offset().top - $(self.params.element).outerHeight(true);
41            }
42        });
43
44    };
45
46    if (params) {
47        this.init(params, callback);
48        // cannot add callback into init method as it is called by subclasses
49        // here we are certain that only base_display element call 'callback'
50        // and not one of its subclasses
51        callback();
52    }
53};
54
55CONFIGURATOR.MODULES.dispatch.registerObject('default_display', CONFIGURATOR.MODULES.DISPLAY.BaseDisplay);
56CONFIGURATOR.MODULES.DISPLAY.BaseDisplay.prototype = new CONFIGURATOR.MODULES.BaseModule;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.