X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e6993e4bfe0e5fd38ccf554da489b5af3625c2fb..dec5a3d8b3a4cc70a9b2bc7bc1305ba0ae11a369:/src/editor/plugins/core/templates.js diff --git a/src/editor/plugins/core/templates.js b/src/editor/plugins/core/templates.js index 69e30f9..bca8467 100644 --- a/src/editor/plugins/core/templates.js +++ b/src/editor/plugins/core/templates.js @@ -34,11 +34,11 @@ var insertTemplateAction = { }; } - description = interpolate(gettext('Insert template %s after %s'), [params.template.name, params.fragment.node.getNearestElementNode().getTagName()]); + description = interpolate(gettext('Insert template %s'), [params.template.name]); return { allowed: true, description: description, - execute: function(params) { + execute: function(callback, params) { var node = params.fragment.node.getNearestElementNode(); node.document.transaction(function() { var toAdd = node.document.createDocumentNode(params.template.content); @@ -46,7 +46,8 @@ var insertTemplateAction = { }, { metadata: { description: description - } + }, + success: callback }); } };