Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: pull image at load instead of full refresh interval #18

Open
markfrancisonly opened this issue Jul 29, 2022 · 0 comments

Comments

@markfrancisonly
Copy link

It appears that the refreshable-picture-card loads with an empty image when configured to pull a camera entity image. expected behavior is refresh of the image on document appearance and cessation of refresh when no longer in view. e.g.

        var hidden, visibilityChange;
        if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support
            hidden = "hidden";
            visibilityChange = "visibilitychange";
        } else if (typeof document.msHidden !== "undefined") {
            hidden = "msHidden";
            visibilityChange = "msvisibilitychange";
        } else if (typeof document.webkitHidden !== "undefined") {
            hidden = "webkitHidden";
            visibilityChange = "webkitvisibilitychange";
        }

        document.addEventListener(visibilityChange, () => {
            if (!document[hidden] ) {
                this.refreshNow();
            } else {
                this.stopRefreshLoop();
            }
        }, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant