Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] TextView - Changing and updating Options at runtime

>Does this work better? 
> var options = {}; 
> options[key] = value;
> editor.getTextView().setOptions(options);

Woow, thank your for your reply and the coincidence is absolutely troubling. I saw your mail when I just came to save my code to correct my mistake with the same solution written in the same form. And yes, you are right, in my desire to make it short, I have introduced a nasty bug ( {key:value}) but right now things are working quite well and I will update after my application in the Cloud.

And if I can add another thing, here is how I was able to change the font-size and the font-family of the TextView

if(key=='font-family' || key=='font-size'){

Wouldn't be nice and more cleaner if you can hide this internal detail and expose the TextView DomNode so I can avoid the use of the style class to get it?


De : Silenio Quarti <Silenio_Quarti@xxxxxxxxxx>
À : lamine <laminba2003@xxxxxxxx>; Orion developer discussions <orion-dev@xxxxxxxxxxx>
Cc : orion-dev-bounces@xxxxxxxxxxx
Envoyé le : Lundi 12 novembre 2012 21h51
Objet : Re: [orion-dev] TextView - Changing and updating Options at runtime

> Hi,
> My name is Mamadou Lamine Ba. I'm presently moving my IDE in the
> cloud and I have successfully integrated the Eclipse Orion editor into
> my application. And since I have the concept of a virtual editor
> which can integrate any _javascript_ source code or WYSIWYG editors, I have
> also integrated ACE, CodeMirror and EditArea. And as my first
> feedback, your editor is by far the most amazing even without
> theming and the support for the other languages.

Really good to know. Thanks for your feedback.

> One of my questions is : why the TextView does not update itself
> when I change its configuration  at runtime via the setOptions method.

> tab.setConfig=function(key,value){
> editor.getTextView().setOptions({key:value});
> };

This should work properly. It seems the bug is in the tab.setConfig() function because If I put a breakpoint in TextView.setOptions(), it gets called with an object like this:

        key: true

It should be something like:

        readonly: true

Does this work better?

  var options = {};
  options[key] = value;


Back to the top