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

Problem with setting basepath #456

Closed
kaizencodes opened this issue Feb 2, 2016 · 1 comment
Closed

Problem with setting basepath #456

kaizencodes opened this issue Feb 2, 2016 · 1 comment

Comments

@kaizencodes
Copy link

Hi,
I'm trying to use alloy editor with react through npm, based on https://github.com/ipeychev/alloyeditor-react-component
To the package.json I've added : "alloyeditor": "^0.7.3"
run npm install

in application.js which is loaded in every page i have:

window['CKEDITOR_BASEPATH'] = "alloyeditor/";
window['ALLOYEDITOR_BASEPATH'] = "alloyeditor/";

I have a react component at: project_folder/app/assets/javascripts/components/inputs/textarea.js:

var AlloyEditor = require('alloyeditor');
...

  componentDidMount: function() {
    this._editor = AlloyEditor.editable(this.props.id);
  },

...
When I instantiate a textarea I get the error :
TypeError: c[a] is undefined
a));var c=this;d=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?d()..

The basepath is not set correctly. The path is set, I've checked in the browser, yet ckeditor fails to load. I tried setting it in numerous ways with no results. What I understood, is that in the example project the path is set to the dist folder, which in my case is set in node_modules/alloyeditor/dist/alloy-editor/ that didn't help either.
What could be the problem? Any help would be greatly appreciated.

@ipeychev
Copy link
Contributor

ipeychev commented Feb 2, 2016

Hello,

Are there any errors in the network tab of the development tools of your browser? This will tell you if it is set properly, of not - if not set correctly, the browser will fail to download the needed resources.

You may also check if the value in this.props.id points indeed to the ID of a valid DOM element - you may do it by executing document.querySelector(this.props.id) before passing this value to AlloyEditor and check the result.

Also, please update the editor to ver. 0.7.5 in your package.json

Hope that helps,

@ipeychev ipeychev closed this as completed Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants