GithubHelp home page GithubHelp logo

IE8 Insert Image about wysihtml5 HOT 4 CLOSED

tiff avatar tiff commented on July 28, 2024
IE8 Insert Image

from wysihtml5.

Comments (4)

tiff avatar tiff commented on July 28, 2024

This works for me correctly when using the example editor:
http://tifftiff.de/wysihtml5/examples/advanced.html

Are you trying to insert the image in a different way?

from wysihtml5.

bobanj avatar bobanj commented on July 28, 2024

Yes, I use an overlay/modal where the user enters the image url. I do it like this:
editor.fire("unset_placeholder"); // remove placeholder if first thing in the editor is link/image
editor.focus();
editor.composer.commands.exec("insertImage", imageUrl);

from wysihtml5.

tiff avatar tiff commented on July 28, 2024

Ah I see. The problem you are dealing with is a pure IE issue.
This crappy browser loses it's selection whenever you unfocus it.

You can fix that easily:
Before the editor loses focus in order to show the modal window do var bookmark = editor.composer.selection.getBookmark();

When the editor receives focus again (after closing the modal window) do:
editor.composer.selection.setBookmark(bookmark);

You might also need to set unselectable="on" on the button element that triggers the modal window to prevent the editor from losing focus too early (before you capture the bookmark).

Hope this helps.

from wysihtml5.

bobanj avatar bobanj commented on July 28, 2024

Than you Christopher :) that is very helpful. :) works like a charm

from wysihtml5.

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.