From fbbe467a7edd03607ad04e4372862c31f0bc97d5 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 2 Dec 2013 16:24:24 +0000 Subject: [PATCH] Unbind previous click handler before setting a new one, or they get doubled. --- etemplate/js/et2_widget_url.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_url.js b/etemplate/js/et2_widget_url.js index decff0edda..c5f892598c 100644 --- a/etemplate/js/et2_widget_url.js +++ b/etemplate/js/et2_widget_url.js @@ -252,7 +252,8 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM], case "url-phone": if(typeof link == 'function') { - this.span.click(this, link); + this.span.off('click.et2_url'); + this.span.on('click.et2_url', link); this.span.attr("href", "#"); } else if (link) @@ -263,7 +264,8 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM], case "url-email": if(typeof link == 'function') { - this.span.click(this, link); + this.span.off('click.et2_url'); + this.span.on('click.et2_url', link); this.span.removeAttr("href"); } else