Code Monkey home page Code Monkey logo

Comments (1)

KalobTaulien avatar KalobTaulien commented on July 19, 2024

Hey @Quadric

I have the JavaScript not sending updates in the Wagtail admin when the live preview iframe is closed. My thinking was: if the iframe is closed the server shouldn't need to support requests it's not going to use. But I hadn't thought about the livepreview in a new window situation.

I'd like to stick to my original idea of not sending requests to the server if the iframe is closed, but adding livepreview window support is definitely important. I think there could be a very simple solution; it could be as easy as a file or simple query lookup. My idea is.. if someone clicked the Live Preview button it will open a new tab — it could also send a request to the server to create a file (or table row) to mark the page as "currently in live preview window". When that flag is active, the JavaScript could continue to send updates to the server even if the iframe is closed. The flag would need an active-until timestamp that's no more than 1 minute a head of right now, this way when the livepreview window is closed (and there isn't JavaScript support to detect when the window is closed) and the iframe is also closed, it doesn't keep sending requests to the server.

That's just my initial idea ¯_(ツ)_/¯ Im happy to discuss other ideas or improvements though! And I'm also happy to take PRSs!

from wagtail-livepreview.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.