[DE mobile] [PE mobile] Fix user output order

This commit is contained in:
Julia Svinareva 2019-06-04 15:59:25 +03:00
parent d5b432d950
commit 4fb6e2abbf
2 changed files with 14 additions and 4 deletions

View file

@ -584,14 +584,19 @@ define([
initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
} }
if(!item.asc_getView()) { if(!item.asc_getView()) {
usersArray.push({ var userAttr = {
color: item.asc_getColor(), color: item.asc_getColor(),
id: item.asc_getId(), id: item.asc_getId(),
idOriginal: item.asc_getIdOriginal(), idOriginal: item.asc_getIdOriginal(),
name: item.asc_getUserName(), name: item.asc_getUserName(),
view: item.asc_getView(), view: item.asc_getView(),
initial: initials initial: initials
}) };
if(item.asc_getIdOriginal() == _userId) {
usersArray.unshift(userAttr);
} else {
usersArray.push(userAttr);
}
} }
}); });
var userSort = _.chain(usersArray).groupBy('idOriginal').value(); var userSort = _.chain(usersArray).groupBy('idOriginal').value();

View file

@ -173,14 +173,19 @@ define([
initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
} }
if(!item.asc_getView()) { if(!item.asc_getView()) {
usersArray.push({ var userAttr = {
color: item.asc_getColor(), color: item.asc_getColor(),
id: item.asc_getId(), id: item.asc_getId(),
idOriginal: item.asc_getIdOriginal(), idOriginal: item.asc_getIdOriginal(),
name: item.asc_getUserName(), name: item.asc_getUserName(),
view: item.asc_getView(), view: item.asc_getView(),
initial: initials initial: initials
}) };
if(item.asc_getIdOriginal() == _userId) {
usersArray.unshift(userAttr);
} else {
usersArray.push(userAttr);
}
} }
}); });
var userSort = _.chain(usersArray).groupBy('idOriginal').value(); var userSort = _.chain(usersArray).groupBy('idOriginal').value();