all files / src/components/slider/controllers/ osSlider.ts

95.45% Statements 21/22
100% Branches 4/4
85.71% Functions 6/7
95.45% Lines 21/22
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          13×     10×              
"use strict";
var OsSlider = (function () {
    function OsSlider($element, $scope) {
        var _this = this;
        this.$element = $element;
        this.$scope = $scope;
        this.setVisibility();
        $scope.$watch(function () {
            _this.setVisibility();
        });
    }
    OsSlider.prototype.toggle = function () {
        this.opened = !this.opened;
        this.setVisibility();
    };
    OsSlider.prototype.setVisibility = function () {
        if (this.opened) {
            this.$element.addClass('os-slider-opened');
        }
        else {
            this.$element.removeClass('os-slider-opened');
        }
    };
    OsSlider.prototype.isOpened = function () {
        return this.opened == true;
    };
    OsSlider.prototype.iconName = function () {
        return this.isOpened() ? 'keyboard_arrow_left' : 'keyboard_arrow_right';
    };
    OsSlider.$inject = ['$element', '$scope'];
    return OsSlider;
}());
exports.OsSlider = OsSlider;