Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 5548b86

Browse files
committed
Improved quick emoji selector
1 parent 3c3de23 commit 5548b86

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

app/css/desktop.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ a.footer_link.active:active {
662662
.im_emoji_quick_select_area a {
663663
display: inline-block;
664664
padding: 5px;
665+
outline: 0;
665666
}
666667

667668
.im_emoji_quick_select_area a:hover {

app/js/lib/mtproto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
1212

1313
var dcOptions = Config.Modes.test
1414
? [
15-
{id: 1, host: '173.240.5.253', port: 80},
15+
{id: 1, host: '149.154.175.10', port: 80},
1616
{id: 2, host: '149.154.167.40', port: 80},
1717
{id: 3, host: '174.140.142.5', port: 80}
1818
]

app/js/services.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,7 +2719,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
27192719

27202720
var doc = angular.copy(docs[docID]),
27212721
isGif = doc.mime_type == 'image/gif',
2722-
isSticker = doc.mime_type == 'image/webp' || doc.mime_type.substr(0, 6) == 'image/' && doc.sticker,
2722+
isSticker = doc.mime_type.substr(0, 6) == 'image/' && doc.sticker,
27232723
thumbPhotoSize = doc.thumb,
27242724
width, height;
27252725

@@ -2736,7 +2736,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
27362736
location: {
27372737
_: 'inputDocumentFileLocation',
27382738
id: doc.id,
2739-
access_hash: doc.access_hash
2739+
access_hash: doc.access_hash,
2740+
dc_id: doc.dc_id
27402741
},
27412742
w: doc.w,
27422743
h: doc.h,

app/vendor/jquery.emojiarea/jquery.emojiarea.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
ConfigStorage.set({emojis_recent: curEmojis});
207207

208208
if (quickSelect) {
209-
quickSelect.load(0);
209+
quickSelect.changed = true;
210210
}
211211
})
212212
};
@@ -709,17 +709,26 @@
709709

710710
var EmojiQuickSelectArea = function(emojiarea, $items) {
711711
var self = this;
712+
var $body = $(document.body);
712713

713714
this.emojiarea = emojiarea;
715+
this.changed = false;
714716
this.$items = $items;
715717

716718
this.load(0);
717719
this.$items.on('click', 'a', function(e) {
718720
var emoji = $('.label', $(this)).text();
719721
self.onItemSelected(emoji);
722+
self.changed = true;
720723
e.stopPropagation();
721724
return false;
722725
});
726+
$body.on('message_send', function(e) {
727+
if (self.changed) {
728+
self.load(0);
729+
self.changed = false;
730+
}
731+
});
723732
};
724733

725734
util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype);

0 commit comments

Comments
 (0)