all files / renderer/ virtual-content-render.js

100% Statements 28/28
100% Branches 4/4
100% Functions 6/6
100% Lines 28/28
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42   1137×   91× 91× 91× 91× 91×     83× 83× 20× 20× 20× 20×     12× 12×   20× 20×     63×          
define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var VirtualContentRenderer = (function () {
        function VirtualContentRenderer(parent) {
            this.parent = parent;
        }
        VirtualContentRenderer.prototype.renderWrapper = function () {
            this.wrapper = ej2_base_1.createElement('div', { className: 'e-virtualtable', styles: 'position: absolute; transform: translate(0px, 0px);' });
            this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper);
            this.virtualTrack = ej2_base_1.createElement('div', { className: 'e-virtualtrack', styles: 'position: relative; pointer-events: none; width: 100%;' });
            this.parent.ganttChartModule.scrollElement.appendChild(this.virtualTrack);
            this.wrapper.appendChild(this.parent.ganttChartModule.chartBodyContent);
        };
        VirtualContentRenderer.prototype.appendChildElements = function (element) {
            this.wrapper.appendChild(element);
        };
        VirtualContentRenderer.prototype.adjustTable = function () {
            var content = this.parent.treeGrid.getContent().querySelector('.e-content').querySelector('.e-virtualtable');
            if (this.parent.enableTimelineVirtualization) {
                var virtualTable = document.getElementsByClassName('e-virtualtable')[1].style.transform;
                var treegridVirtualHeight = this.parent.treeGrid.element.getElementsByClassName('e-virtualtable')[0].style.transform;
                var translateXValue = void 0;
                if (virtualTable !== '') {
                    translateXValue = virtualTable.match(/translate.*\((.+)\)/)[1].split(', ')[0];
                }
                else {
                    var chartTransform = this.parent.ganttChartModule.scrollElement.getElementsByClassName('e-virtualtable')[0].style.transform;
                    translateXValue = chartTransform.match(/translate.*\((.+)\)/)[1].split(', ')[0];
                }
                var translateYValue = treegridVirtualHeight.match(/translate.*\((.+)\)/)[1].split(', ')[1];
                this.parent.ganttChartModule.virtualRender.wrapper.style.transform = "translate(" + translateXValue + ", " + translateYValue + ")";
            }
            else {
                this.parent.ganttChartModule.virtualRender.wrapper.style.transform = content.style.transform;
            }
        };
        return VirtualContentRenderer;
    }());
    exports.VirtualContentRenderer = VirtualContentRenderer;
});