1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-31 08:34:10 +02:00

Make sure the app is loaded before hooking account selectors

This commit is contained in:
chylex 2017-03-08 13:06:50 +01:00
parent 79f6df121b
commit 11a1423f76

View File

@ -497,18 +497,20 @@
// //
// Block: Swap shift key functionality for selecting accounts. // Block: Swap shift key functionality for selecting accounts.
// //
$(".js-drawer[data-drawer='compose']").delegate(".js-account-list > .js-account-item", "click", function(e){ onAppReady.push(function(){
e.shiftKey = !e.shiftKey; $(".js-drawer[data-drawer='compose']").delegate(".js-account-list > .js-account-item", "click", function(e){
}); e.shiftKey = !e.shiftKey;
});
TD.components.AccountSelector.prototype.refreshPostingAccounts = appendToFunction(TD.components.AccountSelector.prototype.refreshPostingAccounts, function(){ TD.components.AccountSelector.prototype.refreshPostingAccounts = appendToFunction(TD.components.AccountSelector.prototype.refreshPostingAccounts, function(){
if (!this.$node.attr("td-account-selector-hook")){ if (!this.$node.attr("td-account-selector-hook")){
this.$node.attr("td-account-selector-hook", "1"); this.$node.attr("td-account-selector-hook", "1");
this.$node.delegate(".js-account-item", "click", function(e){ this.$node.delegate(".js-account-item", "click", function(e){
e.shiftKey = !e.shiftKey; e.shiftKey = !e.shiftKey;
}); });
} }
});
}); });
// //