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

Set 768px min width on content only, not header and footer #213

Merged
merged 1 commit into from
Sep 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions app/layout/header/header.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,52 @@

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

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

function HeaderController($window, $state, $stateParams, TcAuthService, CONSTANTS, $log, $rootScope, UserService, ProfileService) {
function HeaderController($state, TcAuthService, CONSTANTS, $log, $rootScope, UserService, ProfileService) {
var vm = this;
vm.domain = CONSTANTS.domain;
vm.login = TcAuthService.login;
vm.logout = logout;

activate();

function activate() {
initHeaderProps('default');

// List of events that might force header update
angular.forEach([
CONSTANTS.EVENT_USER_LOGGED_IN,
CONSTANTS.EVENT_USER_LOGGED_OUT,
], function(event) {
$rootScope.$on(event, function() {
initHeaderProps(event);
});
});
}

function initHeaderProps(event) {
$log.debug(event + ' triggered header update.');
vm.isAuth = TcAuthService.isAuthenticated();
if (vm.isAuth) {
vm.userHandle = UserService.getUserIdentity().handle;
ProfileService.getUserProfile(vm.userHandle).then(function(data) {

ProfileService.getUserProfile(vm.userHandle)
.then(function(data) {
vm.profile = data;
})
.catch(function(resp) {
})
.catch(function(err) {
$log.error("Unable to get user data");
// todo handle error
})
});
}
}
// init props default
initHeaderProps('default');

function logout() {
TcAuthService.logout().then(
function() {
// success
$state.go('home');
});
};

// List of events that might force header update
angular.forEach([
CONSTANTS.EVENT_USER_LOGGED_IN,
CONSTANTS.EVENT_USER_LOGGED_OUT,
], function(event) {
$rootScope.$on(event, function() {
initHeaderProps(event);
TcAuthService.logout()
.then(function() {
$state.go('home');
});
});
};
}

})();
2 changes: 1 addition & 1 deletion app/topcoder.constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular.module("CONSTANTS", [])

.constant("CONSTANTS", {
"API_URL": "https://api.topcoder-qa.com/v3.0.0-BETA",
"API_URL": "https://api.topcoder-dev.com/v3",
"API_URL_V2": "https://api.topcoder-dev.com/v2",
"ASSET_PREFIX": "",
"auth0Callback": "https://api.topcoder-dev.com/pub/callback.html",
Expand Down
8 changes: 6 additions & 2 deletions assets/css/topcoder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ html {
body {
@include source-sans-regular;
background-color: $ui-page-gray;
}

.notifications {
@media screen and (min-device-width: 768px) {
min-width: 768px;
}
}

.notifications {
.notifications-container {
position: static;
z-index: 0;
Expand All @@ -34,6 +35,9 @@ body {
.view-container {
padding-bottom: 60px;
min-height: 480px;
@media screen and (min-device-width: 768px) {
min-width: 768px;
}
}

.notifications {
Expand Down