(feat) integrated md-datepicker and enabled it in the Preferences module (Vacation)
The date picker suffers from this bug: https://github.com/angular/material/issues/4192 Which makes it not that usable right now.pull/100/head
parent
ded467e0a2
commit
744cba4422
|
@ -748,11 +748,9 @@
|
|||
<var:string label:value="Disable auto reply on" />
|
||||
</md-checkbox>
|
||||
|
||||
<div class="value">
|
||||
<p class="PseudoField-inputLike--underline">
|
||||
<input ng-disabled="app.preferences.defaults.Vacation.endDateEnabled == 0" type="date" ng-model="app.preferences.defaults.Vacation.endDate"/>
|
||||
</p>
|
||||
</div>
|
||||
<md-datepicker
|
||||
ng-disabled="app.preferences.defaults.Vacation.endDateEnabled == 0"
|
||||
ng-model="app.preferences.defaults.Vacation.endDate"><!-- datepicker --></md-datepicker>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,8 +24,23 @@
|
|||
data.SOGoMailLabelsColors = labels;
|
||||
|
||||
// We convert our list of autoReplyEmailAddresses/forwardAddress into a string.
|
||||
if (data.Vacation && data.Vacation.autoReplyEmailAddresses)
|
||||
// We also convert our date objects into real date, otherwise we'll have strings
|
||||
// or undefined values and the md-datepicker does NOT like this.
|
||||
if (data.Vacation) {
|
||||
if (data.Vacation.endDate)
|
||||
data.Vacation.endDate = new Date(parseInt(data.Vacation.endDate) * 1000);
|
||||
else {
|
||||
data.Vacation.endDateEnabled = 0;
|
||||
data.Vacation.endDate = new Date();
|
||||
}
|
||||
|
||||
if (data.Vacation.autoReplyEmailAddresses)
|
||||
data.Vacation.autoReplyEmailAddresses = data.Vacation.autoReplyEmailAddresses.join(",");
|
||||
} else {
|
||||
data.Vacation = {};
|
||||
data.Vacation.endDateEnabled = 0;
|
||||
data.Vacation.endDate = new Date();
|
||||
}
|
||||
|
||||
if (data.Forward && data.Forward.forwardAddress)
|
||||
data.Forward.forwardAddress = data.Forward.forwardAddress.join(",");
|
||||
|
@ -42,8 +57,6 @@
|
|||
var match = /^(.+)\s<(\S+)>$/.exec(value);
|
||||
return new Preferences.$User({uid: key, cn: match[1], c_email: match[2]});
|
||||
});
|
||||
else
|
||||
data.Calendar.PreventInvitationsWhitelist = [];
|
||||
|
||||
angular.extend(_this.settings, data);
|
||||
|
||||
|
@ -134,8 +147,15 @@
|
|||
|
||||
preferences.defaults.SOGoMailLabelsColors = labels;
|
||||
|
||||
if (preferences.defaults.Vacation && preferences.defaults.Vacation.autoReplyEmailAddresses)
|
||||
if (preferences.defaults.Vacation) {
|
||||
if (preferences.defaults.Vacation.endDateEnabled)
|
||||
preferences.defaults.Vacation.endDate = preferences.defaults.Vacation.endDate.getTime()/1000;
|
||||
else
|
||||
preferences.defaults.Vacation.endDate = 0;
|
||||
|
||||
if (preferences.defaults.Vacation.autoReplyEmailAddresses)
|
||||
preferences.defaults.Vacation.autoReplyEmailAddresses = preferences.defaults.Vacation.autoReplyEmailAddresses.split(",");
|
||||
}
|
||||
|
||||
if (preferences.defaults.Forward && preferences.defaults.Forward.forwardAddress)
|
||||
preferences.defaults.Forward.forwardAddress = preferences.defaults.Forward.forwardAddress.split(",");
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
/*! datepicker/_extends.scss - */
|
||||
@import '../../../angular-material/src/components/datepicker/calendar.scss';
|
|
@ -0,0 +1,2 @@
|
|||
/*! datepicker/_extends.scss - */
|
||||
@import '../../../angular-material/src/components/datepicker/datePicker.scss';
|
|
@ -0,0 +1,2 @@
|
|||
/// calendar.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
|
||||
@import 'extends-calendar';
|
|
@ -0,0 +1,2 @@
|
|||
/// datePicker.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
|
||||
@import 'extends-datePicker';
|
|
@ -1,2 +1,2 @@
|
|||
/// menu..scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
|
||||
/// menu.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
|
||||
@import 'extends';
|
||||
|
|
|
@ -165,3 +165,9 @@ $swift-ease-in: all $swift-ease-in-duration $swift-ease-in-timing-function !defa
|
|||
$swift-ease-in-out-duration: 0.5s !default;
|
||||
$swift-ease-in-out-timing-function: cubic-bezier(0.35, 0, 0.25, 1) !default;
|
||||
$swift-ease-in-out: all $swift-ease-in-out-duration $swift-ease-in-out-timing-function !default;
|
||||
|
||||
// Fab Buttons (shared between buttons.scss and fab*.scss)
|
||||
// -------------------------------------------
|
||||
$button-fab-width: rem(5.600) !default;
|
||||
$button-fab-height: rem(5.600) !default;
|
||||
$button-fab-padding: rem(1.60) !default;
|
|
@ -33,9 +33,11 @@
|
|||
@import 'components/checkbox/checkbox';
|
||||
@import 'components/chips/chips';
|
||||
@import 'components/content/content';
|
||||
@import 'components/datepicker/calendar';
|
||||
@import 'components/datepicker/datePicker';
|
||||
@import 'components/dialog/dialog';
|
||||
@import 'components/divider/divider';
|
||||
//@import 'components/favActions/fabActions';
|
||||
//@import 'components/fabActions/fabActions';
|
||||
@import 'components/fabSpeedDial/fabSpeedDial';
|
||||
//@import 'components/fabToolbar/fabToolbar';
|
||||
//@import 'components/fabTrigger/fabTrigger';
|
||||
|
|
Loading…
Reference in New Issue