Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-05-18 11:50:10

Mr Bojangles
New member
Registered: 2005-05-16
Posts: 5

Focus window on Xinha editor

I would like to be able to make the browser scroll to an instance of xinha editor. For example if i have a regular <textarea> i can do document.getElementById("textareaID").focus() and this works fine. but for some reason i can not do this with a Xinha textarea. An thoughts on how to accomplish this??

Offline

#2 2005-05-18 12:29:37

guillaumed
Xinha Administrator
From: Lyon, France
Registered: 2005-02-23
Posts: 85

Re: Focus window on Xinha editor

At first glance (meaning poor knowledge and thinking time) the focus should be setted on the Xinha div created not the textarea

Hope that helps!

Offline

#3 2005-05-18 12:48:53

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Focus window on Xinha editor

the focus should be set to the iframe created by xinha!

editor.focusEditor()

...where editor is the editor-object.


...although i think that setting the focus doesn't scroll the page(?)


Niko

Offline

#4 2005-05-18 13:00:18

Mr Bojangles
New member
Registered: 2005-05-16
Posts: 5

Re: Focus window on Xinha editor

editor.focusEditor() doesn't scroll the browser to the xinha instance. I suppose I could use scrollTo() sad  but how do you know the coordinates of the editor?

Offline

#5 2005-05-18 15:26:09

Mr Bojangles
New member
Registered: 2005-05-16
Posts: 5

Re: Focus window on Xinha editor

Ok, so I can now get the the browser window to scroll to a certain instance by doing this...

make a link <a href="javascript:goTo(edName)"/>

function goTo(edName) {

xinha_editors[edName].activateEditor();   
xinha_editors[edName].focusEditor();
xinha_editors[edName].scrollToElement();

}

The problem is this will only work in IE and I would like it to work in FF too. Also, if you click the link once and it takes you to the editor, then scroll back up and click it again it doesn't work, seems like something to do with focus still being on the editor??

Offline

#6 2005-05-19 17:31:23

Mr Bojangles
New member
Registered: 2005-05-16
Posts: 5

Re: Focus window on Xinha editor

Still can't get this to work in firefox, anyone else have a clue?

Offline

Board footer

Powered by FluxBB