diff --git a/src/wp-includes/js/customize-base.js b/src/wp-includes/js/customize-base.js
index 628d267456..0115071c14 100644
|
a
|
b
|
window.wp = window.wp || {};
|
| 845 | 845 | * @param {Function} [params.template] - Function for rendering template. If not provided, this will come from templateId. |
| 846 | 846 | * @param {string} [params.templateId] - ID for template to render the notification. |
| 847 | 847 | * @param {string} [params.containerClasses] - Additional class names to add to the notification container. |
| 848 | | * @param {boolean} [params.dismissible] - Whether the notification can be dismissed. |
| | 848 | * @param {boolean|number} [params.dismissible] - Whether the notification can be dismissed or the delay in milliseconds before it is auto dismissed. |
| 849 | 849 | */ |
| 850 | 850 | initialize: function( code, params ) { |
| 851 | 851 | var _params; |
| … |
… |
window.wp = window.wp || {};
|
| 875 | 875 | * @returns {jQuery} Notification container element. |
| 876 | 876 | */ |
| 877 | 877 | render: function() { |
| | 878 | |
| 878 | 879 | var notification = this, container, data; |
| 879 | 880 | if ( ! notification.template ) { |
| 880 | 881 | notification.template = wp.template( notification.templateId ); |
| … |
… |
window.wp = window.wp || {};
|
| 889 | 890 | if ( 'keydown' === event.type && 13 !== event.which ) { |
| 890 | 891 | return; |
| 891 | 892 | } |
| | 893 | removeNotification(); |
| | 894 | }); |
| 892 | 895 | |
| | 896 | var removeNotification = function() { |
| 893 | 897 | if ( notification.parent ) { |
| 894 | 898 | notification.parent.remove( notification.code ); |
| 895 | 899 | } else { |
| 896 | 900 | container.remove(); |
| 897 | 901 | } |
| 898 | | }); |
| | 902 | }; |
| | 903 | |
| | 904 | // if the 'dismissible' param is a number, remove the notification after a delay defined by this number in milliseconds |
| | 905 | // make sure the delay is > 500 ms. |
| | 906 | if ( _.isNumber( notification.dismissible ) ) { |
| | 907 | _.delay( removeNotification, Math.max( 500, notification.dismissible ) ); |
| | 908 | } |
| | 909 | |
| 899 | 910 | } |
| 900 | 911 | |
| 901 | 912 | return container; |