GithubHelp home page GithubHelp logo

Comments (5)

ejholmes avatar ejholmes commented on June 15, 2024

You should be able to get around this by adding some hooks to your js that initializes the html editor:

$('.html_editor').editor(window.AA.editor_config)

from active_admin_editor.

roughneck avatar roughneck commented on June 15, 2024

Hey,

Thanks for the quick reply. I added it to active_admin.js but doesn't seem to have any effect. Wrong file?

from active_admin_editor.

ejholmes avatar ejholmes commented on June 15, 2024

You're adding DOM elements dynamically. You need to attach the editor to
these elements once they've been created. The above code is what you need
to run to attach the editor, but you'll need to make sure it gets called
after the DOM elements are created.

On Monday, April 8, 2013, Patrick Bartels wrote:

Hey,

Thanks for the quick reply. I added it to active_admin.js but doesn't seem
to have any effect. Wrong file?


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-16059048
.

from active_admin_editor.

razielgn avatar razielgn commented on June 15, 2024

When I re-run

$('.html_editor').editor(window.AA.editor_config)

it breaks somewhere in JQuery UI's $.widget.bridge: https://github.com/jquery/jquery-ui/blob/1-10-stable/ui/jquery.ui.widget.js#L200.

It tries to call the method option on an instance of Editor, but there isn't.
Also, JQuery UI 1.10.x expects an object responding to _init, returned by option, while JQuery UI master just expects option on the instance.

Hope I was clear.

/cc @ingo86

from active_admin_editor.

ryanwanger avatar ryanwanger commented on June 15, 2024

I'm struggling with this too. After the page loads, if I type $('.html_editor').editor(window.AA.editor_config) into the console, I get TypeError: instance.option is not a function

Individually, window.AA.editor_config returns an object and $('.html_editor').editor returns a function.

from active_admin_editor.

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.