(js) Fix handling of mail labels in Preferences

pull/203/head
Francis Lachapelle 2016-03-09 16:08:51 -05:00
parent 9d5de9afb7
commit efc34658ec
3 changed files with 4 additions and 4 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ Enhancements
Bug fixes
- [web] fixed missing columns in SELECT statements (PostgreSQL)
- [web] fixed display of ghosts when dragging events
- [web] fixed management of mail labels in Preferences module
3.0.2 (2016-03-04)
------------------

View File

@ -690,8 +690,7 @@
id="mailLabelsView-content" class="md-padding">
<md-list layout="row" layout-xs="column" layout-wrap="layout-wrap">
<md-list-item flex="50" flex-xs="100"
ng-repeat="(key, value) in
app.preferences.defaults.SOGoMailLabelsColors">
ng-repeat="(key, value) in app.preferences.defaults.SOGoMailLabelsColors">
<sg-color-picker ng-model="value[1]"><!-- color picker--></sg-color-picker>
<md-input-container class="md-block md-flex">
<input type="text"

View File

@ -15,7 +15,7 @@
this.defaultsPromise = Preferences.$$resource.fetch("jsonDefaults").then(function(data) {
// We swap $key -> _$key to avoid an Angular bug (https://github.com/angular/angular.js/issues/6266)
var labels = _.zipObject(_.map(data.SOGoMailLabelsColors, function(value, key) {
var labels = _.fromPairs(_.map(data.SOGoMailLabelsColors, function(value, key) {
if (key.charAt(0) == '$')
return ['_' + key, value];
return [key, value];
@ -197,7 +197,7 @@
});
// We swap _$key -> $key to avoid an Angular bug (https://github.com/angular/angular.js/issues/6266)
labels = _.zipObject(_.map(preferences.defaults.SOGoMailLabelsColors, function(value, key) {
labels = _.fromPairs(_.map(preferences.defaults.SOGoMailLabelsColors, function(value, key) {
if (key.charAt(0) == '_' && key.charAt(1) == '$') {
// New key, let's take the value and flatten it
if (key.length > 2 && key.charAt(2) == '$') {