[#6574] Add wiki toolbars to each new finance item
This commit is contained in:
1 parent
3479ded9a6
commit
0d6ee39f42
1 file changed
+11
-1
@@ -118,8 +118,12 @@ jQuery(function($) {
|
|||||||
if (t.length > 0) {
|
if (t.length > 0) {
|
||||||
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
|
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 + "]");
|
||||||
|
var newItem = $(wrapperElement).html(newContent)
|
||||||
|
|
||||||
$(wrapperElement).html(newContent).appendTo(appendTemplateTo);
|
newItem.appendTo(appendTemplateTo);
|
||||||
|
newItem.find("textarea.wiki-edit").each(function () {
|
||||||
|
attachWikiToolbar(this.id);
|
||||||
|
});
|
||||||
showDeliverableAddButtons();
|
showDeliverableAddButtons();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -201,3 +205,9 @@ jQuery(function($) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
// Global functions outside of jQuery scoping
|
||||||
|
function attachWikiToolbar(id) {
|
||||||
|
var jsToolBarInstance = new jsToolBar($(id));
|
||||||
|
jsToolBarInstance.draw();
|
||||||
|
}
|
||||||
Reference in new issue
Block a user