Commit 20f4dcac7c6626cd8976f47d7cb7603de0951172
1 parent
80a4085b11
Exists in
master
and in
1 other branch
class name at top of dropdown
Showing 3 changed files with 9 additions and 6 deletions Side-by-side Diff
home.html
View file @
20f4dca
... | ... | @@ -43,8 +43,7 @@ |
43 | 43 | <li class="divider"></li> |
44 | 44 | <li><a ui-sref="addclass">Add Class</a></li> |
45 | 45 | </ul> |
46 | - | |
47 | - <li><a class="dropdown-button" href="#!" data-activates="dropdown1">Classes<i | |
46 | + <li ng-show="currentSection"><a class="dropdown-button" href="#!" data-activates="dropdown1">{{currentSection?currentSection.short_name:"Classes"}}<i | |
48 | 47 | class="mdi-navigation-arrow-drop-down right"></i></a></li> |
49 | 48 | <li><a ui-sref="study">Study</a></li> |
50 | 49 | <li><a ui-sref="logout">Logout</a></li> |
... | ... | @@ -86,6 +85,7 @@ |
86 | 85 | <script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.js"></script> |
87 | 86 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script> |
88 | 87 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script> |
88 | +<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-resource.min.js"></script> | |
89 | 89 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.js"></script> |
90 | 90 | |
91 | 91 |
scripts/FeedController.js
View file @
20f4dca
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | controller('FeedController', function ($scope, $rootScope, $stateParams, $state, $http) { |
3 | 3 | console.log('Hello from feed'); |
4 | 4 | sectionId = $stateParams.sectionId; |
5 | - $rootScope.sectionId = sectionId; | |
5 | + $rootScope.currentSection = $rootScope.SectionResource.get({sectionId: sectionId}); | |
6 | 6 | $scope.cards = []; |
7 | 7 | |
8 | 8 | var loc = window.location, new_uri; |
... | ... | @@ -113,6 +113,7 @@ |
113 | 113 | }; |
114 | 114 | |
115 | 115 | $(document).keydown(function (e) { |
116 | + console.log(e.which); | |
116 | 117 | var keyed = e.which; |
117 | 118 | if (keyed == 67 && listenForC) { // "c" or "C" for compose |
118 | 119 | $('#newCard').openModal(modal_options); |
scripts/RootController.js
View file @
20f4dca
1 | -angular.module('flashy.RootController', ['ui.router']). | |
1 | +angular.module('flashy.RootController', ['ui.router', 'ngResource']). | |
2 | 2 | |
3 | - controller('RootController', function ($rootScope, $scope, $state, UserService) { | |
3 | + controller('RootController', function ($rootScope, $resource, $scope, $state, UserService) { | |
4 | + $rootScope.SectionResource = $resource('/api/sections/:sectionId/'); | |
5 | + window.rootscope = $rootScope; | |
4 | 6 | $rootScope.isLoggedIn = false; |
5 | - $rootScope.sectionId = 0; | |
7 | + $rootScope.currentSection = {}; | |
6 | 8 | UserService.getUserData().then(function (data) { |
7 | 9 | console.log(data); |
8 | 10 | $rootScope.user = data; |