From 25dcdd24623e350a14e2eb2a96085859c4d4aea0 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 24 Jul 2017 11:52:18 +0530 Subject: [PATCH] [minor] add clear in msgpring --- frappe/public/js/frappe/ui/messages.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/ui/messages.js b/frappe/public/js/frappe/ui/messages.js index 761f87a202..35f3e93f8a 100644 --- a/frappe/public/js/frappe/ui/messages.js +++ b/frappe/public/js/frappe/ui/messages.js @@ -137,11 +137,16 @@ frappe.msgprint = function(msg, title) { data.message = ''; } - if(data.message.search(/
|

|

  • /)==-1) + if(data.message.search(/
    |

    |

  • /)==-1) { msg = replace_newlines(data.message); + } - - var msg_exists = msg_dialog.msg_area.html(); + if(data.clear) { + msg_dialog.msg_area.empty(); + var msg_exists = false; + } else { + var msg_exists = msg_dialog.msg_area.html(); + } if(data.title || !msg_exists) { // set title only if it is explicitly given