Unverified Commit 2fc2fbb4 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #10708 from akx/on-ui-update-throttled

Add onAfterUiUpdate callback
parents 5d29672b dc7a1bbb
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -50,13 +50,14 @@ module.exports = {
    globals: {
        //script.js
        gradioApp: "readonly",
        executeCallbacks: "readonly",
        onAfterUiUpdate: "readonly",
        onOptionsChanged: "readonly",
        onUiLoaded: "readonly",
        onUiUpdate: "readonly",
        onOptionsChanged: "readonly",
        uiCurrentTab: "writable",
        uiElementIsVisible: "readonly",
        uiElementInSight: "readonly",
        executeCallbacks: "readonly",
        uiElementIsVisible: "readonly",
        //ui.js
        opts: "writable",
        all_gallery_buttons: "readonly",
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ function dimensionChange(e, is_width, is_height) {
}


onUiUpdate(function() {
onAfterUiUpdate(function() {
    var arPreviewRect = gradioApp().querySelector('#imageARPreview');
    if (arPreviewRect) {
        arPreviewRect.style.display = 'none';
+1 −3
Original line number Diff line number Diff line
@@ -167,6 +167,4 @@ var addContextMenuEventListener = initResponse[2];
})();
//End example Context Menu Items

onUiUpdate(function() {
    addContextMenuEventListener();
});
onAfterUiUpdate(addContextMenuEventListener);
+1 −1
Original line number Diff line number Diff line
// attaches listeners to the txt2img and img2img galleries to update displayed generation param text when the image changes

let txt2img_gallery, img2img_gallery, modal = undefined;
onUiUpdate(function() {
onAfterUiUpdate(function() {
    if (!txt2img_gallery) {
        txt2img_gallery = attachGalleryListeners("txt2img");
    }
+1 −1
Original line number Diff line number Diff line
@@ -39,5 +39,5 @@ function imageMaskResize() {
    });
}

onUiUpdate(imageMaskResize);
onAfterUiUpdate(imageMaskResize);
window.addEventListener('resize', imageMaskResize);
Loading