From c84a2d87792dfd1157999cb252b91c20f1d4ffc6 Mon Sep 17 00:00:00 2001 From: Rahul Kachhadiya Date: Sat, 19 May 2018 13:12:58 +0530 Subject: [PATCH 1/3] Refactor message popup js --- .../templates/system/messages/popup.phtml | 24 +++++++------------ .../adminhtml/web/js/system/messages/popup.js | 24 +++++++++++++++++++ 2 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js diff --git a/app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml b/app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml index a97293547e132..d654504a41e5c 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml +++ b/app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml @@ -19,20 +19,12 @@ - + \ No newline at end of file diff --git a/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js new file mode 100644 index 0000000000000..4463f3bee84ea --- /dev/null +++ b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js @@ -0,0 +1,24 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +*/ + +define([ + "jquery", + "Magento_Ui/js/modal/modal" +], function($){ + 'use strict'; + + return function (data, element) { + if (this.modal) { + this.modal.html($(element).html()); + } else { + this.modal = $(element).modal({ + modalClass: data.class, + type: 'popup', + buttons: [] + }); + } + this.modal.modal('openModal'); + }; +}); \ No newline at end of file From 2d559e49da9e3db165259784e697c5c78d96fab0 Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Sat, 19 May 2018 21:12:59 +0530 Subject: [PATCH 2/3] Fixed coding standard issue. --- .../view/adminhtml/web/js/system/messages/popup.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js index 4463f3bee84ea..42b9fa144dc7a 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js +++ b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js @@ -4,9 +4,10 @@ */ define([ - "jquery", - "Magento_Ui/js/modal/modal" -], function($){ + 'jquery', + 'Magento_Ui/js/modal/modal' +], function ($) { + 'use strict'; return function (data, element) { @@ -21,4 +22,4 @@ define([ } this.modal.modal('openModal'); }; -}); \ No newline at end of file +}); From 817de2203127be1b04ce15a25b94f717cf26d756 Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Sun, 20 May 2018 20:16:14 +0530 Subject: [PATCH 3/3] Updated coding standard issue --- .../view/adminhtml/web/js/system/messages/popup.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js index 42b9fa144dc7a..f3f6a5fb1a123 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js +++ b/app/code/Magento/AdminNotification/view/adminhtml/web/js/system/messages/popup.js @@ -7,7 +7,6 @@ define([ 'jquery', 'Magento_Ui/js/modal/modal' ], function ($) { - 'use strict'; return function (data, element) {