gobimca2012 / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
GNU General Public License v2.0
0 stars 0 forks source link

Doesn't work within a jQuery dialog #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a simple dialog
<div id="dialog">
<textarea id="html_dialog_content" rows="13" cols="59">asdf</textarea>
..

that I'm opening with:  

$("#dialog").dialog({ 
modal: true, 
title:"Demo"
});

I've initialised the editor with this command:
$('#html_dialog_content').wysiwyg();

which works outside of the dialog but within the dialog I can not enter any
text. The controls are there and look good but it is pretty useless if I
can enter any text!

Thanks!

Original issue reported on code.google.com by remo.lau...@gmail.com on 11 Sep 2008 at 7:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi, have u found a solution?  I have a similar problem with the Boxy plugin...
(http://code.google.com/p/jwysiwyg/issues/detail?id=49)

Original comment by jf.stgermain@gmail.com on 1 Oct 2008 at 3:39

GoogleCodeExporter commented 9 years ago
Nope.. I've been debugging it for a while but I guess I'm looking at the wrong 
place. 
It's difficult to find a problem in a code you haven't written that doesn't 
raise an 
exception or an error message.

Original comment by remo.lau...@gmail.com on 1 Oct 2008 at 4:05

GoogleCodeExporter commented 9 years ago
My situation is similar - i initialize the plugin on content that is still not
visible/part of the page DOM. This causes Firefox to NOT initialize the iframe
content, meaning that the following code fails as element.contentWindow is null:

19   if ( element.nodeName.toLowerCase() == 'iframe' )
20       return element.contentWindow.document;

If I delay the call to .wysiwyg till after the textarea is visible problem goes 
away
(not a very pretty workaround, as it messes with the usual flow of things)

Original comment by bossh...@gmail.com on 13 Oct 2008 at 11:21

GoogleCodeExporter commented 9 years ago
bosshcco, can you be more specific?

I am currently running into this problem.

I call the .dialog() on as part of $(document).ready(), and after i call the 
dialog
then i also call the .wysiwyg, what is your method of delaying the wysiwyg call 
until
after the document is visible?

Original comment by elliot.c...@gmail.com on 2 Jan 2009 at 10:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Please attach demo with your problem.

I'll review and fix it.

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 5:40

GoogleCodeExporter commented 9 years ago
Any1 has a solution for this?

Original comment by daniel...@gmail.com on 29 Dec 2009 at 5:32

GoogleCodeExporter commented 9 years ago
If you are experiencing "element.contentWindow is null" error and don't use 
autoSave
try to set autoSave: false
It helped for me ;)

Original comment by dark...@gmail.com on 4 Jan 2010 at 1:53

GoogleCodeExporter commented 9 years ago
The issue is primarily caused because of re-initialization of wysiwig editor. 
You can 
easily get around the issue by creating the textarea at the open command of the 
dialog like this: 

$("#edittechspecs").dialog({
...
open: function() { 
$("#edittechspecs").append('<textarea name="technicalspecs" id="technicalspecs" 
class="text ui-widget-content ui-corner-all"></textarea>');
$("#technicalspecs").val($('#technicalspecscell').html()); 
$('#technicalspecs').wysiwyg();  
}, 

and then destroy the element at the close like this: 

close: function() {
$('#edittechspecs').children().remove();
}

This works perfect with all browsers but there is another minor issue with 
Chrome 
when using the editor in dialog. The header of the dialog seems to be pushed up 
and 
misaligned when the editor is shown in dialog. It looks like it's caused by 
open/close iframe document commands (which is weird). I don't think it's really 
necessary to open and close the document, so I commented out those sections and 
it's 
working now. 

line 487 in jquery.wysiwyg.js: 

//this.editorDoc.open();

line 496 in jquery.wysiwyg.js: 

//this.editorDoc.close();

This does not seem to cause any problems in IE8, FF3 and Safari 4. I hope this 
helps. 

Cagdas Ucar
CTO
http://carsinia.com

Original comment by cagdasucar1976 on 8 Mar 2010 at 9:22

GoogleCodeExporter commented 9 years ago
thx Cagdas Ucar very much!!!
it works nice!!!!

Original comment by mydyb...@gmail.com on 10 Mar 2010 at 4:31

GoogleCodeExporter commented 9 years ago
Wouldn't it be easier and more "jQuery style" to have a proxy method that 
resizes the
editor ?

the only needed code in such a case would be:

$("#edittechspecs").dialog({
  ...
  open: function() { 
    $('#technicalspecs').wysiwyg('resize', 'auto');
  }
  ...
});

whatever, it would definitively be great to see this fixed 
(I usualy send patches, but I'm definitively out of time for now)

regards,

Julien

Original comment by the.moue...@gmail.com on 15 Mar 2010 at 3:36

GoogleCodeExporter commented 9 years ago
Will be reviewed.

Original comment by akzhan.a...@gmail.com on 30 Mar 2010 at 8:25

GoogleCodeExporter commented 9 years ago
we are also facing the same issue and tried all the things mentioned above but 
none is 
working for me.Please help as we are struck from too many days and not find any 
thing 
relevant by googling

Original comment by singh.pa...@gmail.com on 5 Apr 2010 at 11:38

GoogleCodeExporter commented 9 years ago
Hello Singh,

To help you effectively, please attach simple HTML page that covers exactly 
your case.

Original comment by akzhan.a...@gmail.com on 5 Apr 2010 at 12:20

GoogleCodeExporter commented 9 years ago
we are using velocity at view layer.i am attaching the sample files .
in test1.vm file we have two links and click on any link an dialog box is open 
and that 
dialog box contains the content of test2.vm file. test2.vm file contains the 
textarea 
with jwysiwyg editor when first time test1.vm load and the user clicks on any 
link it 
opens the dialog boz with jwysiwyg editor associated with text area. after 
closing that 
dialog when i click on another link shown in test1.vm then dialog box open with 
content 
of test2.vm but jwysiwyg editor is not associated with text area. i have done a 
lot of 
googling but not find any solution yet.

Original comment by singh.pa...@gmail.com on 6 Apr 2010 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
Please retry with code from

http://github.com/akzhan/jwysiwyg

Today we make workaround for one of Firefox bugs.

Original comment by akzhan.a...@gmail.com on 7 Apr 2010 at 3:53

GoogleCodeExporter commented 9 years ago
Legend! Thanks so much for the update :)

Original comment by calo...@gmail.com on 7 Apr 2010 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by akzhan.a...@gmail.com on 27 Jun 2010 at 10:25

GoogleCodeExporter commented 9 years ago
I have the same problem with using the textbox in a Fancybox popup.

It won't let me enter any text.

Any ideas?

Original comment by rickyd...@gmail.com on 28 Sep 2010 at 10:38