Use notice close button from WP

Notice close button looked different than the WP-native one. This reuses the WP button.

[MAILPOET-1448]
This commit is contained in:
Jan Jakeš
2018-07-29 15:06:28 +02:00
parent c5ee742b01
commit cccf40e65f
2 changed files with 2 additions and 9 deletions

View File

@ -172,8 +172,8 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) { // eslint-disab
}
if (this.options.hideClose === false) {
this.element.append('<a href="javascript:;" class="mailpoet_notice_close"><span class="dashicons dashicons-dismiss"></span></a>');
this.element.find('.mailpoet_notice_close').on('click', function () { // eslint-disable-line func-names
this.element.append('<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>');
this.element.find('.notice-dismiss').on('click', function () { // eslint-disable-line func-names
jQuery(this).trigger('close');
});
}