"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;
|