webcol/Calima

View on GitHub
public_/librerias/angular/js/components/navbars.js

Summary

Maintainability
A
0 mins
Test Coverage
(function() {
  'use strict';

  var module = angular.module('mobile-angular-ui.components.navbars', []);

  angular.forEach(['top', 'bottom'], function(side) {
    var directiveName = 'navbarAbsolute' + side.charAt(0).toUpperCase() + side.slice(1);
    module.directive(directiveName, [
      '$rootElement',
      function($rootElement) {
        return {
          restrict: 'C',
          link: function(scope, elem) {
            $rootElement.addClass('has-navbar-' + side);
            scope.$on('$destroy', function(){
              $rootElement.removeClass('has-navbar-' + side);
            });
            }
          };
        }
    ]);
  });

})();