Skip to content

Commit

Permalink
Improved quick emoji selector
Browse files Browse the repository at this point in the history
  • Loading branch information
zhukov committed Jan 2, 2015
1 parent 3c3de23 commit 5548b86
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/css/desktop.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/js/lib/mtproto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
Expand Down
5 changes: 3 additions & 2 deletions app/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion app/vendor/jquery.emojiarea/jquery.emojiarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
ConfigStorage.set({emojis_recent: curEmojis});

if (quickSelect) {
quickSelect.load(0);
quickSelect.changed = true;
}
})
};
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5548b86

Please sign in to comment.