Change tab title when loading a team

pull/1/head
yflory 2019-10-04 17:57:46 +02:00
parent db2f233c44
commit 2385f65869
3 changed files with 11 additions and 2 deletions

View File

@ -1217,5 +1217,6 @@
"team_deleteConfirm": "Vous êtes sur le point de supprimer les données d'une équipe entière. Cette action peut impacter l'accès à leur données pour d'autres membres de l'équipe. La suppression est irréversible. Êtes-vous sûr de vouloir continuer ?",
"team_pendingOwner": "(en attente)",
"team_pendingOwnerTitle": "Cet administrateur n'a pas encore accepté l'offre de devenir propriétaire de l'équipe.",
"team_demoteMeConfirm": "Vous êtes sur le point de renoncer à vos droits. Vous ne serez pas en mesure d'annuler cette action. Continuer ?"
"team_demoteMeConfirm": "Vous êtes sur le point de renoncer à vos droits. Vous ne serez pas en mesure d'annuler cette action. Continuer ?",
"team_title": "Équipe : {0}"
}

View File

@ -1217,5 +1217,6 @@
"team_deleteConfirm": "You are about to delete all of an entire team's data. This may impact other team members access to their data. This cannot be undone. Are you sure you want to proceed?",
"team_pendingOwner": "(pending)",
"team_pendingOwnerTitle": "This administrator has not accepted the ownership offer yet.",
"team_demoteMeConfirm": "You are about to give up your rights. You will not be able to undo this action. Are you sure?"
"team_demoteMeConfirm": "You are about to give up your rights. You will not be able to undo this action. Are you sure?",
"team_title": "Team: {0}"
}

View File

@ -98,6 +98,8 @@ define([
sframeChan.query('Q_SET_TEAM', null, function (err) {
if (err) { return void console.error(err); }
if (APP.drive && APP.drive.close) { APP.drive.close(); }
$('.cp-toolbar-title-value').text(Messages.type.teams);
sframeChan.event('EV_SET_TAB_TITLE', Messages.type.teams);
APP.team = null;
APP.teamEdPublic = null;
APP.drive = null;
@ -341,8 +343,13 @@ define([
common.displayAvatar($(avatar), team.metadata.avatar, team.metadata.name);
$(btn).click(function () {
APP.module.execCommand('SUBSCRIBE', id, function () {
var t = Messages._getKey('team_title', [Util.fixHTML(team.metadata.name)]);
sframeChan.query('Q_SET_TEAM', id, function (err) {
if (err) { return void console.error(err); }
// Change title
$('.cp-toolbar-title-value').text(t);
sframeChan.event('EV_SET_TAB_TITLE', t);
// Load data
APP.team = id;
APP.teamEdPublic = Util.find(team, ['keys', 'drive', 'edPublic']);
buildUI(common, true, team.owner);