From 5548b86b45a8de6a5e3c74ed475ae381059edf81 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 2 Jan 2015 21:28:13 +0100 Subject: [PATCH] Improved quick emoji selector --- app/css/desktop.css | 1 + app/js/lib/mtproto.js | 2 +- app/js/services.js | 5 +++-- app/vendor/jquery.emojiarea/jquery.emojiarea.js | 11 ++++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/css/desktop.css b/app/css/desktop.css index 51905fcf..5b878186 100644 --- a/app/css/desktop.css +++ b/app/css/desktop.css @@ -662,6 +662,7 @@ a.footer_link.active:active { .im_emoji_quick_select_area a { display: inline-block; padding: 5px; + outline: 0; } .im_emoji_quick_select_area a:hover { diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js index cde935e9..cd0ea8fa 100644 --- a/app/js/lib/mtproto.js +++ b/app/js/lib/mtproto.js @@ -12,7 +12,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils']) var dcOptions = Config.Modes.test ? [ - {id: 1, host: '173.240.5.253', port: 80}, + {id: 1, host: '149.154.175.10', port: 80}, {id: 2, host: '149.154.167.40', port: 80}, {id: 3, host: '174.140.142.5', port: 80} ] diff --git a/app/js/services.js b/app/js/services.js index 12cc80d1..6d3520c6 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -2719,7 +2719,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) var doc = angular.copy(docs[docID]), isGif = doc.mime_type == 'image/gif', - isSticker = doc.mime_type == 'image/webp' || doc.mime_type.substr(0, 6) == 'image/' && doc.sticker, + isSticker = doc.mime_type.substr(0, 6) == 'image/' && doc.sticker, thumbPhotoSize = doc.thumb, width, height; @@ -2736,7 +2736,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) location: { _: 'inputDocumentFileLocation', id: doc.id, - access_hash: doc.access_hash + access_hash: doc.access_hash, + dc_id: doc.dc_id }, w: doc.w, h: doc.h, diff --git a/app/vendor/jquery.emojiarea/jquery.emojiarea.js b/app/vendor/jquery.emojiarea/jquery.emojiarea.js index e6ec308a..ea13b328 100644 --- a/app/vendor/jquery.emojiarea/jquery.emojiarea.js +++ b/app/vendor/jquery.emojiarea/jquery.emojiarea.js @@ -206,7 +206,7 @@ ConfigStorage.set({emojis_recent: curEmojis}); if (quickSelect) { - quickSelect.load(0); + quickSelect.changed = true; } }) }; @@ -709,17 +709,26 @@ var EmojiQuickSelectArea = function(emojiarea, $items) { var self = this; + var $body = $(document.body); this.emojiarea = emojiarea; + this.changed = false; this.$items = $items; this.load(0); this.$items.on('click', 'a', function(e) { var emoji = $('.label', $(this)).text(); self.onItemSelected(emoji); + self.changed = true; e.stopPropagation(); return false; }); + $body.on('message_send', function(e) { + if (self.changed) { + self.load(0); + self.changed = false; + } + }); }; util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype);