From 6fa8b3f2e7fc0729a8c314d4046a4cf1f2bc984f Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 11 Oct 2011 16:03:25 -0700 Subject: [PATCH] [#6574] Generate new ids for fixed descriptions for the jsToolBar --- assets/javascripts/contracts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/contracts.js b/assets/javascripts/contracts.js index b872a37..dbe5d7a 100644 --- a/assets/javascripts/contracts.js +++ b/assets/javascripts/contracts.js @@ -117,7 +117,9 @@ jQuery(function($) { var t = $(templateSelector).tmpl({}); if (t.length > 0) { var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder - var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]"); + var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]"); + // New ids for textareas for the jsToolBar to attach to + newContent = newContent.replace(/fixed-description\d*/g, "fixed-description" + Math.floor(Math.random() * 100000000)) var newItem = $(wrapperElement).html(newContent) newItem.appendTo(appendTemplateTo);