require composer when its needed

v1.18.x
barisusakli 10 years ago
parent e862f7186f
commit 1745689317

@ -2,7 +2,7 @@
/* globals define, app, ajaxify, bootbox, socket, templates, utils */
define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components', 'translator'], function(composer, share, navigator, components, translator) {
define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator'], function(share, navigator, components, translator) {
var PostTools = {},
topicName;
@ -117,7 +117,10 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components',
});
postContainer.on('click', '[component="post/edit"]', function(e) {
composer.editPost(getData($(this), 'data-pid'));
var btn = $(this);
require(['composer'], function(composer) {
composer.editPost(getData(btn, 'data-pid'));
});
});
postContainer.on('click', '[component="post/delete"]', function(e) {
@ -138,6 +141,7 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components',
}
function onReplyClicked(button, tid, topicName) {
require(['composer'], function(composer) {
var selectionText = '',
selection = window.getSelection ? window.getSelection() : document.selection.createRange();
@ -157,10 +161,12 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components',
} else {
composer.newReply(tid, getData(button, 'data-pid'), topicName, username ? username + ' ' : '');
}
});
}
function onQuoteClicked(button, tid, topicName) {
require(['composer'], function(composer) {
var username = getUserName(button),
pid = getData(button, 'data-pid');
@ -179,6 +185,7 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components',
composer.newReply(tid, pid, topicName, '[[modules:composer.user_said, ' + username + ']]\n' + quoted);
}
});
});
}
function favouritePost(button, pid) {

Loading…
Cancel
Save