From cd3257d2d3d1ffadce0cf781427edeb180ab2a85 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 10 Mar 2017 15:35:05 +0530 Subject: [PATCH] [minor] rever set_footnote function --- frappe/public/js/frappe/misc/utils.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frappe/public/js/frappe/misc/utils.js b/frappe/public/js/frappe/misc/utils.js index 6144f8e9e8..2de69a0b32 100644 --- a/frappe/public/js/frappe/misc/utils.js +++ b/frappe/public/js/frappe/misc/utils.js @@ -185,21 +185,20 @@ frappe.utils = { me.intro_area = null; } }, - set_footnote: function(footnote_area, wrapper, txt) { - if(!footnote_area) { - footnote_area = $('
') + set_footnote: function(me, wrapper, txt) { + if(!me.footnote_area) { + me.footnote_area = $('
') .appendTo(wrapper); } if(txt) { - if(!txt.includes('

')) - txt = '

' + txt + '

'; - footnote_area.html(txt); + if(txt.search(/

/)==-1) txt = '

' + txt + '

'; + me.footnote_area.html(txt); } else { - footnote_area.remove(); - footnote_area = null; + me.footnote_area.remove(); + me.footnote_area = null; } - return footnote_area; + return me.footnote_area; }, get_args_dict_from_url: function(txt) { var args = {};