File tree Expand file tree Collapse file tree 2 files changed +32
-16
lines changed
app/code/Magento/AdminNotification/view/adminhtml
templates/system/messages Expand file tree Collapse file tree 2 files changed +32
-16
lines changed Original file line number Diff line number Diff line change 19
19
</ul>
20
20
</div>
21
21
22
- <script>
23
- require([
24
- "jquery",
25
- "Magento_Ui/js/modal/modal"
26
- ], function($){
27
- if (this.modal) {
28
- this.modal.html($('[data-role="system_messages_list"]').html());
29
- } else {
30
- this.modal = $('[data-role="system_messages_list"]').modal({
31
- modalClass: 'modal-system-messages ui-popup-message',
32
- type: 'popup',
33
- buttons: []
34
- });
22
+ <script type="text/x-magento-init">
23
+ {
24
+ "[data-role=system_messages_list]": {
25
+ "Magento_AdminNotification/js/system/messages/popup": {
26
+ class: 'modal-system-messages ui-popup-message'
27
+ }
28
+ }
35
29
}
36
- this.modal.modal('openModal');
37
- });
38
- </script>
30
+ </script>
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [
7
+ 'jquery' ,
8
+ 'Magento_Ui/js/modal/modal'
9
+ ] , function ( $ ) {
10
+ 'use strict' ;
11
+
12
+ return function ( data , element ) {
13
+ if ( this . modal ) {
14
+ this . modal . html ( $ ( element ) . html ( ) ) ;
15
+ } else {
16
+ this . modal = $ ( element ) . modal ( {
17
+ modalClass : data . class ,
18
+ type : 'popup' ,
19
+ buttons : [ ]
20
+ } ) ;
21
+ }
22
+ this . modal . modal ( 'openModal' ) ;
23
+ } ;
24
+ } ) ;
You can’t perform that action at this time.
0 commit comments