Commit 36004fd7 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[javascript] allow customization of inlineCreationForm insertion point

--HG--
branch : stable
parent 322272c5d67f
......@@ -243,22 +243,22 @@ function updateInlinedEntitiesCounters(rtype) {
* @param ttype : the target (inlined) entity type
* @param rtype : the relation type between both entities
*/
function addInlineCreationForm(peid, ttype, rtype, role) {
function addInlineCreationForm(peid, ttype, rtype, role, insertBefore) {
insertBefore = insertBefore || getNode('add' + rtype + ':' + peid + 'link').parentNode;
var d = asyncRemoteExec('inline_creation_form', peid, ttype, rtype, role);
d.addCallback(function (response) {
var linknode = getNode('add' + rtype + ':' + peid + 'link');
var dom = getDomFromResponse(response);
preprocessAjaxLoad(null, dom);
var form = jQuery(dom);
form.css('display', 'none');
form.insertBefore(linknode.parentNode).slideDown('fast');
updateInlinedEntitiesCounters(rtype);
reorderTabindex();
form.trigger('inlinedform-added');
preprocessAjaxLoad(null, dom);
var form = jQuery(dom);
form.css('display', 'none');
form.insertBefore(insertBefore).slideDown('fast');
updateInlinedEntitiesCounters(rtype);
reorderTabindex();
form.trigger('inlinedform-added');
postAjaxLoad(dom);
});
d.addErrback(function (xxx) {
log('xxx =', xxx);
log('xxx =', xxx);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment