Announcement

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

#1 2009-04-06 05:46:48

kakulukia
New member
Registered: 2009-04-02
Posts: 4

movable divs

lo there ..

i have some divs inside the editor area that are positioned absolutely to ensure the letter layout keeps intact
http://dl.getdropbox.com/u/851600/letter.jpg

it works fine .. BUT i dont want the user to be able to move or resize the divs .. how can i disable that kinda nice but in this case unwanted feature?


cheers
kaku

Offline

#2 2009-05-11 18:16:25

Varx
New member
Registered: 2009-05-11
Posts: 2

Re: movable divs

I'm trying to figure that feature out as well.

It seems that in firefox I can't move or edit the divs of a page, but in IE I can.
Is there a way to replicate this 'error' in IE ?

-Varx

EDIT: well it seems I can select and move divs in firefox, I just have to use the path links on the bottom of the editor to select the divs.

I'm not that versed in Javascript, but there has to be a way to disable selection of 'Control' objects like images, divs, tables, etc. >.<

Last edited by Varx (2009-05-11 20:00:39)

Offline

#3 2009-05-18 16:34:59

Varx
New member
Registered: 2009-05-11
Posts: 2

Re: movable divs

I think I've figured it out. I've done research on how DesignMode and contenteditable work and if you only want part of the page to be editable then wrap the entire page in a div and make that div contenteditable='false'

then wrap whatever text you want to be editable in contenteditable='true'

containters and text inherit their contenteditable from their container, so since the whole page is wrapped in a contenteditable='false' div then only those things that are explicitly wrapped in a contenteditable='true' will be editable.

In order for this to work in firefox you need to comment out line 3199 like this:

//this._doc.body.contentEditable = false;

and change line 212 like this

 Xinha.is_designMode = false; // (typeof document.designMode != 'undefined' && !Xinha.is_ie); // IE has designMode, but we're not using it

this will force firefox to use contentEditable instead of designmode. Note, this will only work in Firefox > 3.0 and WILL cause the editor to be quarky in firefox. Do this at your own risk.

EDIT:
WARNING: In order for this to work, however, you must disable HTML view since it strips these tags out and it might mess with multiple Xihna instances. Weird things can happen when you start messing around with contentEditable. Especially in firefox where Xihna tries to use designMode instead.
-varx

Last edited by Varx (2009-05-18 17:26:07)

Offline

#4 2009-08-27 05:32:21

kakulukia
New member
Registered: 2009-04-02
Posts: 4

Re: movable divs

thx but this doesnt help .. id like the contents of the div to be editable but not the div itself!

meaning: i can edit everything inside, but i cant move or resize the div!
same goes to tables .. i dont want the user to be able to toucht the table structure .. is there some kinda way to do this?


regards
kakulukia

Offline

Board footer

Powered by FluxBB