mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-08-05 17:09:39 +02:00
hide footer view on chat room, other view show it
This commit is contained in:
@@ -92,6 +92,16 @@
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on('$stateChangeSuccess', stateChangeSuccess);
|
||||
function stateChangeSuccess(event, toState, toParams, fromState, fromParams) {
|
||||
var footer = angular.element('footer');
|
||||
if (toState.name === 'chat') {
|
||||
footer.css('display', 'none');
|
||||
} else {
|
||||
footer.css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* $watch 'vm.messages'
|
||||
* when changed, scroll to bottom
|
||||
@@ -180,9 +190,6 @@
|
||||
e.css('height', h + 'px');
|
||||
u.css('height', h + 'px');
|
||||
|
||||
var footer = angular.element('footer');
|
||||
footer.css('display', 'none');
|
||||
|
||||
var bodysize = angular.element('.bodysize');
|
||||
bodysize.css('backgroundColor', '#f7f7f7');
|
||||
};
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
.module('core')
|
||||
.controller('HeaderController', HeaderController);
|
||||
|
||||
HeaderController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService'];
|
||||
HeaderController.$inject = ['$scope', '$state', '$stateParams', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService'];
|
||||
|
||||
function HeaderController($scope, $state, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService) {
|
||||
function HeaderController($scope, $state, $stateParams, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService) {
|
||||
var vm = this;
|
||||
vm.language = MeanTorrentConfig.meanTorrentConfig.language;
|
||||
|
||||
@@ -24,11 +24,16 @@
|
||||
}
|
||||
|
||||
vm.changeLanguage = function (langKey) {
|
||||
console.log('langKey=' + langKey);
|
||||
localStorageService.set('storage_user_lang', langKey);
|
||||
$translate.use(langKey);
|
||||
var lang = localStorageService.get('storage_user_lang');
|
||||
if (lang !== langKey) {
|
||||
localStorageService.set('storage_user_lang', langKey);
|
||||
$translate.use(langKey);
|
||||
|
||||
$state.reload();
|
||||
$state.reload();
|
||||
//$state.transitionTo($state.current, $stateParams, {
|
||||
// reload: true, inherit: false, notify: false
|
||||
//});
|
||||
}
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -22,14 +22,13 @@
|
||||
element.html(trans);
|
||||
});
|
||||
|
||||
//scope.$on('$stateChangeSuccess', listener);
|
||||
//
|
||||
//function listener(event, toState) {
|
||||
// var menu_title = attrs.menuTitle;
|
||||
// var trans = $translate.instant(menu_title);
|
||||
//
|
||||
// element.html(trans);
|
||||
//}
|
||||
scope.$on('$stateChangeSuccess', listener);
|
||||
function listener(event, toState) {
|
||||
var menu_title = attrs.menuTitle;
|
||||
var trans = $translate.instant(menu_title);
|
||||
|
||||
element.html(trans);
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user