1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-11-23 17:42:46 +01:00
TweetDuck/resources/Content/tweetdeck/focus_composer_after_image_upload.js

16 lines
447 B
JavaScript

import { $, ensureEventExists } from "../api/jquery.js";
import { onAppReady } from "../api/ready.js";
/**
* Refocuses composer input after uploading an image.
*/
export default function() {
onAppReady(function focusComposerAfterImageUpload() {
ensureEventExists(document, "uiComposeImageAdded");
$(document).on("uiComposeImageAdded", function() {
document.querySelector(".js-docked-compose .js-compose-text").focus();
});
});
};