all files / spreadsheet/actions/ collaborative-editing.js

95% Statements 19/20
100% Branches 2/2
87.5% Functions 7/8
95% Lines 19/20
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   121× 121×       121×   121×     121× 121×   18525×        
define(["require", "exports", "../common/index"], function (require, exports, index_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var CollaborativeEditing = (function () {
        function CollaborativeEditing(parent) {
            this.parent = parent;
            this.addEventListener();
        }
        CollaborativeEditing.prototype.refreshClients = function (options) {
            index_1.updateAction(options, this.parent);
        };
        CollaborativeEditing.prototype.addEventListener = function () {
            this.parent.on(index_1.collaborativeUpdate, this.refreshClients, this);
        };
        CollaborativeEditing.prototype.removeEventListener = function () {
            if (!this.parent.isDestroyed) {
                this.parent.off(index_1.collaborativeUpdate, this.refreshClients);
            }
        };
        CollaborativeEditing.prototype.destroy = function () {
            this.removeEventListener();
            this.parent = null;
        };
        CollaborativeEditing.prototype.getModuleName = function () {
            return 'collaborativeEditing';
        };
        return CollaborativeEditing;
    }());
    exports.CollaborativeEditing = CollaborativeEditing;
});