Git Product home page Git Product logo

Comments (10)

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

That's a good idea. I not sure if this will be possible in a cross-browser way as their behaviour in connections with iframes is somehow strange.

from subsectionmanager.

nickdunn avatar nickdunn commented on July 17, 2024

I don't think the iframe would be an issue. So long as you've got the JavaScript inside the iframe itself (which is possible, since you're already embedding your own CSS when the page is loaded in an iframe) you shouldn't need to communicate across the iframe from the parent page — it'll all be done inside the child page.

from subsectionmanager.

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

The problem is that you have to set the focus in the parent section. I'll have a look at it but I know that neither Firefox nor Internet Explorer will be my friends here :)

from subsectionmanager.

nickdunn avatar nickdunn commented on July 17, 2024

You could load the child page in the iframe with a ?iframe=true parameter (or even #iframe) and check this with JS inside the child page with JS to set the focus. This way you don't communciate across the iframe, mitigating the usual security/DOM frustrations.

from subsectionmanager.

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

Ah, I did that in an early version of Mediathek. That works well until the user hit the save button inside the iframe ...

from subsectionmanager.

nickdunn avatar nickdunn commented on July 17, 2024

At which point there need be no auto-focus :-)

from subsectionmanager.

nickdunn avatar nickdunn commented on July 17, 2024

Or... with JS you also append the same GET param to the <form> action so it persists after saving.

We did this with a project where we loaded Symphony forms in a lightbox from the frontend (http://drp.ly/FpX9e ) and it worked pretty well.

from subsectionmanager.

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

Well, that's true. One point for you :)

from subsectionmanager.

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

Or... with JS you also append the same GET param to the

action so it persists after saving.

That's what I did with Mediathek - it didn't work out well. But I'm sure focussing will work, somehow ...

from subsectionmanager.

nilshoerrmann avatar nilshoerrmann commented on July 17, 2024

Subsection Manager should now focus the first input field of the subsection.

from subsectionmanager.

Related Issues (20)

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.