| * Visit http://guide.xosproject.org/devguide/addview/ for more information |
| * Created by teone on 7/18/16. |
| angular.module('xos.uiComponents') |
| .directive('xosSidePanel', function(){ |
| <div class="xos-side-panel-content {{vm.classes.join(' ')}}"> |
| <button type="button" class="close" ng-click="vm.dismiss()"> |
| <span aria-hidden="true">×</span> |
| <div class="col-xs-12" ng-transclude></div> |
| controller: function($scope, $timeout, _){ |
| this.classes.push(this.config.position); |
| this.classes = this.toggleClass(this.classes); |
| return _.remove(this.classes, c => c === 'out'); |
| this.toggleClass = (classes) => { |
| if(classes.indexOf('in') > -1){ |
| _.remove(this.classes, c => c === 'in'); |
| this.classes.push('out'); |
| _.remove(this.classes, c => c === 'out'); |
| $scope.$watch(() => this.show, val => { |
| if (angular.isDefined(val)){ |
| if (val && val === true){ |
| this.classes = this.toggleClass(this.classes); |