[#6574] Add wiki toolbars to each new finance item

This commit is contained in:
Eric Davis
2011-10-11 15:53:56 -07:00
parent 3479ded9a6
commit 0d6ee39f42

View File

@@ -118,8 +118,12 @@ jQuery(function($) {
if (t.length > 0) {
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
var newItem = $(wrapperElement).html(newContent)
$(wrapperElement).html(newContent).appendTo(appendTemplateTo);
newItem.appendTo(appendTemplateTo);
newItem.find("textarea.wiki-edit").each(function () {
attachWikiToolbar(this.id);
});
showDeliverableAddButtons();
}
},
@@ -201,3 +205,9 @@ jQuery(function($) {
}
})(jQuery);
// Global functions outside of jQuery scoping
function attachWikiToolbar(id) {
var jsToolBarInstance = new jsToolBar($(id));
jsToolBarInstance.draw();
}