|
|
|
@ -171,7 +171,7 @@
@@ -171,7 +171,7 @@
|
|
|
|
|
/*! MODIFICATION START |
|
|
|
|
This function was added by Igor Zhukov to save recent used emojis. |
|
|
|
|
*/ |
|
|
|
|
util.emojiInserted = function (emojiKey, menu) { |
|
|
|
|
util.emojiInserted = function (emojiKey, menu, quickSelect) { |
|
|
|
|
ConfigStorage.get('emojis_recent', function (curEmojis) { |
|
|
|
|
curEmojis = curEmojis || []; |
|
|
|
|
|
|
|
|
@ -192,6 +192,10 @@
@@ -192,6 +192,10 @@
|
|
|
|
|
if (menu) { |
|
|
|
|
menu.updateRecentTab(curEmojis); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (quickSelect) { |
|
|
|
|
quickSelect.load(0); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
/*! MODIFICATION END */ |
|
|
|
@ -207,6 +211,11 @@
@@ -207,6 +211,11 @@
|
|
|
|
|
this.$editor.on('blur', function() { self.hasFocus = false; }); |
|
|
|
|
|
|
|
|
|
this.setupButton(); |
|
|
|
|
|
|
|
|
|
if (this.options.quickSelect) { |
|
|
|
|
var $items = $(this.options.quickSelect); |
|
|
|
|
this.quickSelect = new EmojiQuickSelectArea(self, $items); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
EmojiArea.prototype.setupButton = function() { |
|
|
|
@ -278,7 +287,7 @@
@@ -278,7 +287,7 @@
|
|
|
|
|
if (!$.emojiarea.icons.hasOwnProperty(emoji)) return; |
|
|
|
|
util.insertAtCursor(emoji, this.$textarea[0]); |
|
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
|
util.emojiInserted(emoji, this.menu); |
|
|
|
|
util.emojiInserted(emoji, this.menu, this.quickSelect); |
|
|
|
|
this.$textarea.trigger('change'); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -397,7 +406,7 @@
@@ -397,7 +406,7 @@
|
|
|
|
|
/*! MODIFICATION END */ |
|
|
|
|
|
|
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
|
util.emojiInserted(emoji, this.menu); |
|
|
|
|
util.emojiInserted(emoji, this.menu, this.quickSelect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onChange(); |
|
|
|
@ -611,7 +620,7 @@
@@ -611,7 +620,7 @@
|
|
|
|
|
var updateItems = function () { |
|
|
|
|
self.$items.html(html.join('')); |
|
|
|
|
|
|
|
|
|
if (!Config.Mobile) { |
|
|
|
|
if (!Config.Mobile && self.$itemsWrap) { |
|
|
|
|
setTimeout(function () { |
|
|
|
|
self.$itemsWrap.nanoScroller(); |
|
|
|
|
}, 100); |
|
|
|
@ -707,4 +716,21 @@
@@ -707,4 +716,21 @@
|
|
|
|
|
}; |
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
var EmojiQuickSelectArea = function(emojiarea, $items) { |
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
this.emojiarea = emojiarea; |
|
|
|
|
this.$items = $items; |
|
|
|
|
|
|
|
|
|
this.load(0); |
|
|
|
|
this.$items.on('click', 'a', function(e) { |
|
|
|
|
var emoji = $('.label', $(this)).text(); |
|
|
|
|
self.onItemSelected(emoji); |
|
|
|
|
e.stopPropagation(); |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype); |
|
|
|
|
|
|
|
|
|
})(jQuery, window, document); |