From f9d97f2ce732c93c8730642d8d35b2b59979f60a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 4 Nov 2009 15:13:26 -0800 Subject: [PATCH] Always recreate the listener for the question and answer buttons, since their arguments change. Fixes bug #10985. --- docs/changelog/7.x.x.txt | 1 + www/extras/wobject/Survey/editsurvey.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2bfd929a2..da4bc0635 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - Fixed a compatibility problem between WRE and new Spectre code. - fixed #11198: Typo in i18n - fixed #11202: USPS driver does not log authentication errors + - fixed #10985: Survey: can't add multiple choice answer 7.8.3 - Rewrote Spectre's workflow queues to prevent it from "forgetting" about some workflows. diff --git a/www/extras/wobject/Survey/editsurvey.js b/www/extras/wobject/Survey/editsurvey.js index 9c21bf98c..8fa8f98c4 100644 --- a/www/extras/wobject/Survey/editsurvey.js +++ b/www/extras/wobject/Survey/editsurvey.js @@ -161,6 +161,8 @@ Survey.Data = (function(){ }); qButton.on("click", this.addQuestion, d.buttons.question); } + qButton.removeListener("click", this.addQuestion); + qButton.on("click", this.addQuestion, d.buttons.question); if (d.buttons.answer) { YAHOO.util.Dom.setStyle('addAnswer', 'display', 'inline'); @@ -170,8 +172,9 @@ Survey.Data = (function(){ id: "addAnswer", container: "addAnswer" }); - aButton.on("click", this.addAnswer, d.buttons.answer); } + aButton.removeListener("click", this.addAnswer); + aButton.on("click", this.addAnswer, d.buttons.answer); }else{ YAHOO.util.Dom.setStyle('addAnswer', 'display', 'none'); }