fix(web(js)): remove calls to deprecated functions in ng-material

pull/273/head
Francis Lachapelle 2020-08-04 16:12:52 -04:00
parent 8642ff9d00
commit cd95649f08
14 changed files with 30 additions and 24 deletions

View File

@ -16,7 +16,7 @@
<md-menu> <md-menu>
<md-button class="md-icon-button" aria-label="Sort" <md-button class="md-icon-button" aria-label="Sort"
ng-click="$mdOpenMenu()"> ng-click="$mdMenu.open()">
<md-icon>sort</md-icon> <md-icon>sort</md-icon>
</md-button> </md-button>
<md-menu-content> <md-menu-content>

View File

@ -260,7 +260,7 @@
if (cards.length != allCards.length) if (cards.length != allCards.length)
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l("Lists can't be moved or copied.")) .textContent(l("Lists can't be moved or copied."))
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
@ -283,7 +283,7 @@
$state.go('app.addressbook'); $state.go('app.addressbook');
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(success) .textContent(success)
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
}); });

View File

@ -187,7 +187,7 @@
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(msg) .textContent(msg)
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));
}, },
@ -335,7 +335,7 @@
AddressBook.$subscribe(addressbookData.owner, addressbookData.name).then(function(data) { AddressBook.$subscribe(addressbookData.owner, addressbookData.name).then(function(data) {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Successfully subscribed to address book')) .textContent(l('Successfully subscribed to address book'))
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));
}); });
@ -363,7 +363,7 @@
if (cards.length != allCards.length) if (cards.length != allCards.length)
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l("Lists can't be moved or copied.")) .textContent(l("Lists can't be moved or copied."))
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
@ -386,7 +386,7 @@
$state.go('app.addressbook'); $state.go('app.addressbook');
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(success) .textContent(success)
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
}); });

View File

@ -486,7 +486,7 @@
vm.selectedFolder.$copyMessages(selectedMessages, '/' + dstFolder).then(function() { vm.selectedFolder.$copyMessages(selectedMessages, '/' + dstFolder).then(function() {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('%{0} message(s) copied', vm.selectedFolder.$selectedCount())) .textContent(l('%{0} message(s) copied', vm.selectedFolder.$selectedCount()))
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
}); });
@ -500,7 +500,7 @@
vm.selectedFolder.$moveMessages(selectedMessages, '/' + dstFolder).then(function(index) { vm.selectedFolder.$moveMessages(selectedMessages, '/' + dstFolder).then(function(index) {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('%{0} message(s) moved', count)) .textContent(l('%{0} message(s) moved', count))
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
if (Mailbox.$virtualMode) { if (Mailbox.$virtualMode) {

View File

@ -285,7 +285,7 @@
// Show success toast when action succeeds // Show success toast when action succeeds
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Successfully created card')) .textContent(l('Successfully created card'))
.position('top right') .position('top right')
.hideDelay(2000)); .hideDelay(2000));
}); });

View File

@ -150,7 +150,7 @@
onErrorItem: function(item, response, status, headers) { onErrorItem: function(item, response, status, headers) {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Error while uploading the file \"%{0}\":', item.file.name) + .textContent(l('Error while uploading the file \"%{0}\":', item.file.name) +
' ' + (response.message? l(response.message) : '')) ' ' + (response.message? l(response.message) : ''))
.position('top right') .position('top right')
.action(l('OK')) .action(l('OK'))
@ -224,7 +224,7 @@
} }
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Your email has been saved')) .textContent(l('Your email has been saved'))
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));
}); });
@ -255,7 +255,7 @@
} }
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Your email has been sent')) .textContent(l('Your email has been sent'))
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));

View File

@ -457,7 +457,7 @@
if (!options || !options.quick) { if (!options || !options.quick) {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Preferences saved')) .textContent(l('Preferences saved'))
.position('bottom right') .position('bottom right')
.hideDelay(2000)); .hideDelay(2000));
form.$setPristine(); form.$setPristine();
@ -489,7 +489,7 @@
Authentication.changePassword(this.passwords.newPassword, this.passwords.oldPassword).then(function() { Authentication.changePassword(this.passwords.newPassword, this.passwords.oldPassword).then(function() {
var alert = $mdDialog.alert({ var alert = $mdDialog.alert({
title: l('Password'), title: l('Password'),
content: l('The password was changed successfully.'), textContent: l('The password was changed successfully.'),
ok: l('OK') ok: l('OK')
}); });
$mdDialog.show( alert ) $mdDialog.show( alert )

View File

@ -162,7 +162,7 @@
Calendar.$subscribe(calendarData.owner, calendarData.name).then(function(data) { Calendar.$subscribe(calendarData.owner, calendarData.name).then(function(data) {
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(l('Successfully subscribed to calendar')) .textContent(l('Successfully subscribed to calendar'))
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));
}); });

View File

@ -339,7 +339,7 @@
$mdToast.show( $mdToast.show(
$mdToast.simple() $mdToast.simple()
.content(msg) .textContent(msg)
.position('top right') .position('top right')
.hideDelay(3000)); .hideDelay(3000));
}, },

View File

@ -1,3 +1,2 @@
/*! input/_extends.scss - */ /*! input/_extends.scss - */
@import '../../../angular-material/src/components/input/input-variables.scss';
@import '../../../angular-material/src/components/input/input.scss'; @import '../../../angular-material/src/components/input/input.scss';

View File

@ -0,0 +1,3 @@
/// input-variables.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
@import '../../../angular-material/src/components/input/input-variables.scss';

View File

@ -16,7 +16,6 @@ $sg-subheader-padding-left-right: $baseline-grid;
&--with-icon .md-subheader-inner, &--with-icon .md-subheader-inner,
&--with-secondary-icon .md-subheader-inner { &--with-secondary-icon .md-subheader-inner {
line-height: $sg-avatar-width + ($sg-subheader-padding-top-bottom)*2; line-height: $sg-avatar-width + ($sg-subheader-padding-top-bottom)*2;
padding: ($subheader-padding - ($icon-button-height - $subheader-font-size)/2) $baseline-grid;
padding: 0; padding: 0;
padding-left: $subheader-padding; padding-left: $subheader-padding;
} }

View File

@ -112,9 +112,6 @@ $slicer-breakpoint-names: 'xs' 'sm' 'md' 'lg' 'xl';
$media-pointer: (pointer fine); $media-pointer: (pointer fine);
// Button
$button-left-right-padding: rem(0.600);
// Icon // Icon
$icon-size: rem(2.400) !default; $icon-size: rem(2.400) !default;
@ -206,15 +203,22 @@ $material-leave-duration: 0.3s;
$material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1); $material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
$material-leave: all $material-leave-duration $material-leave-timing-function; $material-leave: all $material-leave-duration $material-leave-timing-function;
// Button
$button-left-right-padding: rem(0.800);
$icon-button-height: rem(4.000) !default;
$icon-button-width: rem(4.000) !default;
// Fab Buttons (shared between buttons.scss and fab*.scss) // Fab Buttons (shared between buttons.scss and fab*.scss)
// -------------------------------------------
$button-fab-width: rem(5.600) !default; $button-fab-width: rem(5.600) !default;
$button-fab-height: rem(5.600) !default; $button-fab-height: rem(5.600) !default;
$button-fab-padding: rem(1.60) !default; $button-fab-padding: rem(1.60) !default;
// Shared Checkbox variables // Shared Checkbox variables
$checkbox-width: 20px !default; $checkbox-width: 18px !default;
$checkbox-height: $checkbox-width !default; $checkbox-height: $checkbox-width !default;
$checkbox-border-radius: 2px !default; $checkbox-border-radius: 2px !default;
$checkbox-border-width: 2px !default; $checkbox-border-width: 2px !default;
// Shared Horizontal Margin Variables
$default-horizontal-margin: 16px !default;

View File

@ -25,6 +25,7 @@
// Original angular-material components // Original angular-material components
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
@import 'components/input/input-variables';
@import 'components/autocomplete/autocomplete'; @import 'components/autocomplete/autocomplete';
@import 'components/backdrop/backdrop'; @import 'components/backdrop/backdrop';
//@import 'components/bottomSheet/bottom-sheet'; //@import 'components/bottomSheet/bottom-sheet';