From 9fc95453a506d2a3788ff0694b2ca9c968aa2f4b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 11 Aug 2014 15:12:57 +0530 Subject: [PATCH] fixes in event handling for button --- frappe/public/js/frappe/form/control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 7f897ba9bd..c285c96544 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -525,7 +525,7 @@ frappe.ui.form.ControlButton = frappe.ui.form.ControlData.extend({ }, onclick: function() { if(this.frm && this.frm.doc) { - if(this.frm.script_manager.get_handlers(this.df.fieldname, this.doctype, this.docname)) { + if(this.frm.script_manager.get_handlers(this.df.fieldname, this.doctype, this.docname).length) { this.frm.script_manager.trigger(this.df.fieldname, this.doctype, this.docname); } else { this.frm.runscript(this.df.options, this);