Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 33a08ed

Browse files
committed
Merge pull request #213 from appirio-tech/header-mobile
Set 768px min width on content only, not header and footer
2 parents 1e40645 + 047b004 commit 33a08ed

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

app/layout/header/header.controller.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,52 @@
33

44
angular.module('tc.layout').controller('HeaderController', HeaderController);
55

6-
HeaderController.$inject = ['$window', '$state', '$stateParams', 'TcAuthService', 'CONSTANTS', '$log', '$rootScope', 'UserService', 'ProfileService'];
6+
HeaderController.$inject = ['$state', 'TcAuthService', 'CONSTANTS', '$log', '$rootScope', 'UserService', 'ProfileService'];
77

8-
function HeaderController($window, $state, $stateParams, TcAuthService, CONSTANTS, $log, $rootScope, UserService, ProfileService) {
8+
function HeaderController($state, TcAuthService, CONSTANTS, $log, $rootScope, UserService, ProfileService) {
99
var vm = this;
1010
vm.domain = CONSTANTS.domain;
1111
vm.login = TcAuthService.login;
1212
vm.logout = logout;
1313

14+
activate();
15+
16+
function activate() {
17+
initHeaderProps('default');
18+
19+
// List of events that might force header update
20+
angular.forEach([
21+
CONSTANTS.EVENT_USER_LOGGED_IN,
22+
CONSTANTS.EVENT_USER_LOGGED_OUT,
23+
], function(event) {
24+
$rootScope.$on(event, function() {
25+
initHeaderProps(event);
26+
});
27+
});
28+
}
1429

1530
function initHeaderProps(event) {
1631
$log.debug(event + ' triggered header update.');
1732
vm.isAuth = TcAuthService.isAuthenticated();
1833
if (vm.isAuth) {
1934
vm.userHandle = UserService.getUserIdentity().handle;
20-
ProfileService.getUserProfile(vm.userHandle).then(function(data) {
35+
36+
ProfileService.getUserProfile(vm.userHandle)
37+
.then(function(data) {
2138
vm.profile = data;
22-
})
23-
.catch(function(resp) {
39+
})
40+
.catch(function(err) {
2441
$log.error("Unable to get user data");
2542
// todo handle error
26-
})
43+
});
2744
}
2845
}
29-
// init props default
30-
initHeaderProps('default');
3146

3247
function logout() {
33-
TcAuthService.logout().then(
34-
function() {
35-
// success
36-
$state.go('home');
37-
});
38-
};
39-
40-
// List of events that might force header update
41-
angular.forEach([
42-
CONSTANTS.EVENT_USER_LOGGED_IN,
43-
CONSTANTS.EVENT_USER_LOGGED_OUT,
44-
], function(event) {
45-
$rootScope.$on(event, function() {
46-
initHeaderProps(event);
48+
TcAuthService.logout()
49+
.then(function() {
50+
$state.go('home');
4751
});
48-
});
52+
};
4953
}
50-
5154
})();

app/topcoder.constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
angular.module("CONSTANTS", [])
22

33
.constant("CONSTANTS", {
4-
"API_URL": "https://api.topcoder-qa.com/v3.0.0-BETA",
4+
"API_URL": "https://api.topcoder-dev.com/v3",
55
"API_URL_V2": "https://api.topcoder-dev.com/v2",
66
"ASSET_PREFIX": "",
77
"auth0Callback": "https://api.topcoder-dev.com/pub/callback.html",

assets/css/topcoder.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ html {
1414
body {
1515
@include source-sans-regular;
1616
background-color: $ui-page-gray;
17+
}
18+
19+
.notifications {
1720
@media screen and (min-device-width: 768px) {
1821
min-width: 768px;
1922
}
20-
}
2123

22-
.notifications {
2324
.notifications-container {
2425
position: static;
2526
z-index: 0;
@@ -34,6 +35,9 @@ body {
3435
.view-container {
3536
padding-bottom: 60px;
3637
min-height: 480px;
38+
@media screen and (min-device-width: 768px) {
39+
min-width: 768px;
40+
}
3741
}
3842

3943
.notifications {

0 commit comments

Comments
 (0)