feat: add button to allow for expanding quick-reply composer to full composer

main
Julian Lam 2 years ago
parent 64a92fadeb
commit a671a00cd1

@ -1,10 +1,10 @@
'use strict'; 'use strict';
define('persona/quickreply', [ define('persona/quickreply', [
'components', 'composer/autocomplete', 'api', 'components', 'composer', 'composer/autocomplete', 'api',
'alerts', 'uploadHelpers', 'mousetrap', 'alerts', 'uploadHelpers', 'mousetrap',
], function ( ], function (
components, autocomplete, api, components, composer, autocomplete, api,
alerts, uploadHelpers, mousetrap alerts, uploadHelpers, mousetrap
) { ) {
var QuickReply = {}; var QuickReply = {};
@ -88,6 +88,14 @@ define('persona/quickreply', [
autocomplete._active.persona_qr.hide(); autocomplete._active.persona_qr.hide();
}); });
}); });
components.get('topic/quickreply/expand').on('click', (e) => {
e.preventDefault();
const textEl = components.get('topic/quickreply/text');
composer.newReply(ajaxify.data.tid, undefined, ajaxify.data.title, utils.escapeHTML(textEl.val()));
textEl.val('');
});
}; };
return QuickReply; return QuickReply;

@ -15,7 +15,10 @@
<textarea name="content" component="topic/quickreply/text" class="form-control mousetrap" rows="5" placeholder="[[modules:composer.textarea.placeholder]]"></textarea> <textarea name="content" component="topic/quickreply/text" class="form-control mousetrap" rows="5" placeholder="[[modules:composer.textarea.placeholder]]"></textarea>
<div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div> <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
</div> </div>
<button type="submit" component="topic/quickreply/button" class="btn btn-primary pull-right">[[topic:post-quick-reply]]</button> <div class="btn-group pull-right">
<button type="submit" component="topic/quickreply/button" class="btn btn-primary">[[topic:post-quick-reply]]</button>
<button type="submit" component="topic/quickreply/expand" class="btn btn-default" formmethod="get"><i class="fa fa-expand"></i></button>
</div>
</form> </form>
<form component="topic/quickreply/upload" method="post" enctype="multipart/form-data"> <form component="topic/quickreply/upload" method="post" enctype="multipart/form-data">
<input type="file" name="files[]" multiple class="hidden"/> <input type="file" name="files[]" multiple class="hidden"/>

Loading…
Cancel
Save