diff --git a/public/js/legacy/widgets/form/form_header.js b/public/js/legacy/widgets/form/form_header.js index dd619dbced..ea66cfdf1e 100644 --- a/public/js/legacy/widgets/form/form_header.js +++ b/public/js/legacy/widgets/form/form_header.js @@ -40,7 +40,7 @@ _f.FrmHeader = Class.extend({ if(!frm.meta.issingle) { this.appframe.add_tab(frm.doctype, 0.3, function() { wn.set_route("List", frm.doctype); - }); + }); } }, refresh: function() { @@ -52,10 +52,9 @@ _f.FrmHeader = Class.extend({ wn.views.breadcrumbs(this.appframe, cur_frm.meta.module, cur_frm.meta.name, cur_frm.docname); } - + this.refresh_labels(); this.refresh_toolbar(); - }, refresh_labels: function() { cur_frm.doc = get_local(cur_frm.doc.doctype, cur_frm.doc.name); diff --git a/public/js/legacy/wn/widgets/form/comments.js b/public/js/legacy/wn/widgets/form/comments.js index e4f6d06b08..f499d4ae1e 100644 --- a/public/js/legacy/wn/widgets/form/comments.js +++ b/public/js/legacy/wn/widgets/form/comments.js @@ -29,9 +29,30 @@ wn.widgets.form.sidebar.Comments = function(parent, sidebar, doctype, docname) { $c('webnotes.widgets.form.comments.get_comments', {dt: me.doctype, dn: me.docname, limit: 5}, function(r, rt) { wn.widgets.form.comments.sync(me.doctype, me.docname, r); me.make_body(); + me.refresh_latest_comment(); }); } + this.refresh_latest_comment = function() { + var wrapper = cur_frm.page_layout.body; + if(!$(wrapper).find(".latest-comment").length) { + $('