Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fixed navbar not collapsing (angular-fullstack/generator-angular-full…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kageetai committed Nov 10, 2014
1 parent 3b8c10f commit 8326819
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module.exports = function (grunt) {
target: {
src: '<%= yeoman.client %>/index.html',
ignorePath: '<%= yeoman.client %>/',
exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/', /bootstrap.css/, /font-awesome.css/ ]
exclude: [/bootstrap-sass-official/, '/json3/', '/es5-shim/', /bootstrap.css/, /font-awesome.css/ ]
}
},

Expand Down
7 changes: 7 additions & 0 deletions client/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ angular.module('jayMapApp', [
});
}])

.directive('navbarCollapse', function () {
return function postLink(scope, element) {
var nav = element.find('.navbar-collapse');
element.find('button.navbar-toggle').click(function() { nav.collapse('toggle'); });
};
})

.factory('authInterceptor', function ($rootScope, $q, $cookieStore, $location) {
return {
// Add authorization token to headers
Expand Down
2 changes: 1 addition & 1 deletion client/components/navbar/navbar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="navbar navbar-default navbar-static-top" ng-controller="NavbarCtrl">
<div class="navbar navbar-default navbar-static-top" ng-controller="NavbarCtrl" navbar-collapse>
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" ng-click="isCollapsed = !isCollapsed">
Expand Down
1 change: 1 addition & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
Expand Down

0 comments on commit 8326819

Please sign in to comment.