Barış Soner Uşaklı 6 years ago
parent 3baee00da5
commit dd2c767cc3

@ -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;
});

@ -111,6 +111,13 @@ library.addUserToTopic = function(data, callback) {
callback(null, data);
});
} else {
data.templateData.loggedInUser = {
uid: 0,
username: '[[global:guest]]',
picture: user.getDefaultAvatar(),
'icon:text': '?',
'icon:bgColor': '#aaa',
};
callback(null, data);
}
};

@ -1,4 +1,4 @@
<!-- IF loggedIn -->
<!-- IF privileges.topics:reply -->
<div class="clearfix quick-reply">
<div class="icon pull-left hidden-xs">
<a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->">
@ -21,4 +21,4 @@
<button type="submit" component="topic/quickreply/button" class="btn btn-primary pull-right">Post quick reply</button>
</form>
</div>
<!-- ENDIF loggedIn -->
<!-- ENDIF privileges.topics:reply -->

Loading…
Cancel
Save