diff --git a/assets/js/src/notice.js b/assets/js/src/notice.js index 74127aac79..4382b5e3e4 100644 --- a/assets/js/src/notice.js +++ b/assets/js/src/notice.js @@ -166,8 +166,12 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) { // eslint-disab // if the notice is not static, it has to disappear after a timeout if (this.options.static === false) { - this.element.delay(this.options.timeout).trigger('close'); - } else if (this.options.hideClose === false) { + setTimeout(function (target) { // eslint-disable-line func-names + target.trigger('close'); + }, this.options.timeout, this.element); + } + + if (this.options.hideClose === false) { this.element.append(''); this.element.find('.mailpoet_notice_close').on('click', function () { // eslint-disable-line func-names jQuery(this).trigger('close');