Commit 66b81d76 authored by Omkar Deshpande's avatar Omkar Deshpande
Browse files

Issue #3213661 by hchonov, szloredan, mrinalini9: Add tapToDismiss option

parent 11fc96e7
Loading
Loading
Loading
Loading
+1 −0
Changes for config/install/toastr.settings.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,3 +13,4 @@ toastr_extended_timeout: 10000
toastr_show_duration: 300
toastr_hide_duration: 1000
toastr_leave_errors: 1
toastr_tap_to_dismiss: 1
+3 −0
Changes for config/schema/toastr.schema.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -47,3 +47,6 @@ toastr.settings:
    toastr_leave_errors:
      type: boolean
      label: 'Do not hide error messages'
    toastr_tap_to_dismiss:
      type: boolean
      label: 'Tap to dismiss'
+2 −1
Changes for js/messages.js: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@
              "showEasing": settings.toastr.settings.toastr_show_easing,
              "hideEasing": settings.toastr.settings.toastr_hide_easing,
              "showMethod": settings.toastr.settings.toastr_show_method,
              "hideMethod": settings.toastr.settings.toastr_hide_method
              "hideMethod": settings.toastr.settings.toastr_hide_method,
              "tapToDismiss": settings.toastr.settings.toastr_tap_to_dismiss
            };
            var toastr_message_type = type;
            if (type === 'status') {
+10 −0
Changes for src/Form/ToastrSettingsForm.php: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class ToastrSettingsForm extends ConfigFormBase {
      'toastr_show_duration' => 300,
      'toastr_hide_duration' => 1000,
      'toastr_leave_errors' => 1,
      'toastr_tap_to_dismiss' => TRUE,
    ];
  }

@@ -217,6 +218,15 @@ class ToastrSettingsForm extends ConfigFormBase {
      '#default_value' => $this->getConfigValue('toastr_leave_errors'),
      '#return_value' => 1,
    ];

    $form['toastr_tap_to_dismiss'] = [
      '#title' => $this->t('Tap to dismiss'),
      '#description' => $this->t('If enabled the message will disappear on tap'),
      '#type' => 'checkbox',
      '#default_value' => $this->getConfigValue('toastr_tap_to_dismiss'),
      '#return_value' => 1,
    ];

    return parent::buildForm($form, $form_state);
  }