Skip to content
Permalink
Browse files

fix: #37

  • Loading branch information...
barisusakli committed Mar 16, 2019
1 parent 7613315 commit fd07d6935007116eeff14d7e2eb11af65a34a762
Showing with 40 additions and 34 deletions.
  1. +9 −0 .gitignore
  2. +31 −34 lib/quickreply.js
@@ -0,0 +1,9 @@
*.css
!less/bootstrap-flipped.css
npm-debug.log
sftp-config.json
*.sublime-project
*.sublime-workspace
.idea
.vscode
node_modules/
@@ -2,48 +2,45 @@

/*globals $, app, ajaxify, socket*/

define('slick/quickreply', ['components'], function(components) {
var QuickReply = {};

QuickReply.init = function() {

var element = components.get('topic/quickreply/text');
var data = {
element: element,
strategies: [],
options: {
zIndex: 100,
listPosition: function(position) {
this.$el.css(this._applyPlacement(position));
this.$el.css('position', 'absolute');
return this;
}
}
};

$(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) {
var replyMsg = components.get('topic/quickreply/text').val();
var replyData = {
define('slick/quickreply', ['components', 'composer/autocomplete'], function(components, autocomplete) {
var QuickReply = {};

QuickReply.init = function() {

var element = components.get('topic/quickreply/text');
var data = {
element: element,
strategies: [],
options: {
style: {
'z-index': 100,
},
}
};

$(window).trigger('composer:autocomplete:init', data);
autocomplete._active['slick_qr'] = autocomplete.setup(data);

components.get('topic/quickreply/button').on('click', function(e) {
var replyMsg = components.get('topic/quickreply/text').val();
var replyData = {
tid: ajaxify.data.tid,
handle: undefined,
content: replyMsg
};

socket.emit('posts.reply', replyData, function(err, data) {
if (err) {
app.alertError(err.message);
}
if (data && data.queued) {
if (err) {
app.alertError(err.message);
}
if (data && data.queued) {
app.alertSuccess(data.message);
}
components.get('topic/quickreply/text').val('');
components.get('topic/quickreply/text').val('');
autocomplete._active['slick_qr'].hide();
});
});
};
});
};

return QuickReply;
return QuickReply;
});

0 comments on commit fd07d69

Please sign in to comment.
You can’t perform that action at this time.