1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-29 11:34:07 +02:00

Fix composer input refocus & emoji keyboard broken after switching composers

This commit is contained in:
chylex 2019-05-26 18:02:11 +02:00
parent 85559b6083
commit 4487f1169e
2 changed files with 8 additions and 16 deletions
Resources
Plugins/emoji-keyboard
Scripts

View File

@ -380,13 +380,9 @@ enabled(){
hideKeyboard(); hideKeyboard();
}; };
this.drawerToggleEvent = function(e, data){ this.composerActiveEvent = function(e){
if (data.activeDrawer === "compose"){ $(".emoji-keyboard-popup-btn", me.composeDrawer).on("click", me.emojiKeyboardButtonClickEvent);
setTimeout(function(){ $(".js-docked-compose .js-compose-scroller > .scroll-v", me.composeDrawer).on("scroll", me.composerScrollEvent);
$(".emoji-keyboard-popup-btn", me.composeDrawer).on("click", me.emojiKeyboardButtonClickEvent);
$(".js-docked-compose .js-compose-scroller > .scroll-v", me.composeDrawer).on("scroll", me.composerScrollEvent);
}, 0);
}
}; };
this.documentClickEvent = function(e){ this.documentClickEvent = function(e){
@ -414,7 +410,7 @@ enabled(){
if (maybeDockedComposePanel.length){ if (maybeDockedComposePanel.length){
maybeDockedComposePanel.find(".cf.margin-t--12.margin-b--30").first().append(buttonHTML); maybeDockedComposePanel.find(".cf.margin-t--12.margin-b--30").first().append(buttonHTML);
this.drawerToggleEvent({}, { activeDrawer: "compose" }); this.composerActiveEvent();
} }
} }
@ -424,7 +420,7 @@ ready(){
$(document).on("click", this.documentClickEvent); $(document).on("click", this.documentClickEvent);
$(document).on("keydown", this.documentKeyEvent); $(document).on("keydown", this.documentKeyEvent);
$(document).on("uiDrawerActive", this.drawerToggleEvent); $(document).on("tduckOldComposerActive", this.composerActiveEvent);
$(document).on("uiComposeImageAdded", this.uploadFilesEvent); $(document).on("uiComposeImageAdded", this.uploadFilesEvent);
this.composeDrawer.on("uiComposeTweetSending", this.composerSendingEvent); this.composeDrawer.on("uiComposeTweetSending", this.composerSendingEvent);
@ -550,7 +546,7 @@ disabled(){
$(document).off("click", this.documentClickEvent); $(document).off("click", this.documentClickEvent);
$(document).off("keydown", this.documentKeyEvent); $(document).off("keydown", this.documentKeyEvent);
$(document).off("uiDrawerActive", this.drawerToggleEvent); $(document).off("tduckOldComposerActive", this.composerActiveEvent);
$(document).off("uiComposeImageAdded", this.uploadFilesEvent); $(document).off("uiComposeImageAdded", this.uploadFilesEvent);
this.composeDrawer.off("uiComposeTweetSending", this.composerSendingEvent); this.composeDrawer.off("uiComposeTweetSending", this.composerSendingEvent);

View File

@ -1060,12 +1060,8 @@
setTimeout(refocusInput, 0); setTimeout(refocusInput, 0);
}; };
$(document).on("uiDrawerActive", function(e, data){ $(document).on("tduckOldComposerActive", function(e){
if (data.activeDrawer === "compose"){ $$(".js-account-list", ".js-docked-compose").delegate(".js-account-item", "click", accountItemClickEvent);
setTimeout(function(){
$$(".js-account-list", ".js-docked-compose").delegate(".js-account-item", "click", accountItemClickEvent);
}, 0);
}
}); });
}); });