Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$mdDialog confirm rearrange cancel-ok to ok-cancel

In our web app I use Angular-Materials $mdDialog with the confirm-object. Is it possible to change the order of the buttons from cancel-ok to ok-cancel? And to set the initial focus to the cancel button? Maybe via CSS or a template?

The code looks like that:

var confirm = this.$mdDialog.confirm()
  .parent(angular.element(document.body))
  .title('Löschen')
  .content('Möchten Sie wirklich löschen?')
  .ariaLabel('Löschen')
  .ok('Ja')
  .cancel('Nein')
  .targetEvent(event);

this.$mdDialog.show(confirm)
  .then(() => {
     // do something
  });

enter image description here

like image 743
swimagers Avatar asked Feb 07 '23 17:02

swimagers


1 Answers

This might work:

md-dialog md-dialog-actions {
    display: block;
}

md-dialog md-dialog-actions button {
    float: right;
}
like image 65
Thomas Ghesquiere Avatar answered Feb 13 '23 05:02

Thomas Ghesquiere