all files / src/components/zoombar/controllers/ osZoombar.ts

100% Statements 18/18
100% Branches 8/8
100% Functions 4/4
100% Lines 18/18
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                         
"use strict";
var OsZoombar = (function () {
    function OsZoombar($element) {
        this.$element = $element;
    }
    OsZoombar.prototype.zoomIn = function () {
        var newZoomLevel = Math.min(this.ngModel + 1, this.zoomMax);
        if (angular.isFunction(this.ngChange) && this.ngModel !== newZoomLevel) {
            this.ngModel = newZoomLevel;
            this.ngChange(this.ngModel);
        }
        else {
            this.ngModel = newZoomLevel;
        }
    };
    OsZoombar.prototype.zoomOut = function () {
        var newZoomLevel = Math.max(this.ngModel - 1, this.zoomMin);
        if (angular.isFunction(this.ngChange) && this.ngModel !== newZoomLevel) {
            this.ngModel = newZoomLevel;
            this.ngChange(this.ngModel);
        }
        else {
            this.ngModel = newZoomLevel;
        }
    };
    OsZoombar.$inject = ['$element'];
    return OsZoombar;
}());
exports.OsZoombar = OsZoombar;