|
|
|
@ -4,9 +4,9 @@
|
|
|
|
|
|
|
|
|
|
define('persona/quickreply', ['components'], function(components) {
|
|
|
|
|
var QuickReply = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QuickReply.init = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var element = components.get('topic/quickreply/text');
|
|
|
|
|
var data = {
|
|
|
|
|
element: element,
|
|
|
|
@ -20,11 +20,11 @@ define('persona/quickreply', ['components'], function(components) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(window).trigger('composer:autocomplete:init', data);
|
|
|
|
|
data.element.textcomplete(data.strategies, data.options);
|
|
|
|
|
$('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
components.get('topic/quickreply/button').on('click', function(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var replyMsg = components.get('topic/quickreply/text').val();
|
|
|
|
@ -38,10 +38,13 @@ define('persona/quickreply', ['components'], function(components) {
|
|
|
|
|
if (err) {
|
|
|
|
|
app.alertError(err.message);
|
|
|
|
|
}
|
|
|
|
|
if (data && data.queued) {
|
|
|
|
|
app.alertSuccess(data.message);
|
|
|
|
|
}
|
|
|
|
|
components.get('topic/quickreply/text').val('');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return QuickReply;
|
|
|
|
|
});
|
|
|
|
|