Open GoogleCodeExporter opened 8 years ago
My current fix is to add a global variable:
var isSubmitRteEventWiredUp = false;
and wrap the submit event wire up:
if (isSubmitRteEventWiredUp == false) {
$(self.iframe).parents('form').submit(
function() { self.disable_design_mode(true); }
);
isSubmitRteEventWiredUp = true;
}
This seems to work but I feel like it could be problematic.
Original comment by gd.wing...@gmail.com
on 5 Mar 2009 at 8:00
Still can't reproduce that bug :( There was 'duplicate problem' in the past,
but i
was sure it was fixed. I'm going to release next version soon, try to test new
wersion. because right now i haven't that problem forages - at least i'm using
it as
editor for my cms.
Original comment by plandem
on 5 Mar 2009 at 10:45
have you tried last version?
Original comment by plandem
on 9 Mar 2009 at 3:03
Ok, I've tested with the last version(1.2) and run with both jQuery 1.2.6 and
1.3.2.
I get the same results as before.
I have an aspx form with the lwRTE control. If I don't include the code I
posted in
comment 1 and I submit the form in visual editing mode an <input> control is
created
for each time the editor was toggled back and forth.
This tells me that each time I toggle into the visual editor the function
enable_design_mode is being called and 'function() {
self.disable_design_mode(true);'
is being added to the parent form submit event. When the submit event is
called it
runs through the 'self.disable_design_mode(true);' function for each time the
editor
was toggled and creates an <input> control. I can watch this happen in firebug
and
have attached a screen shot.
I'm sure the code I'm using isn't the best solution but I have not been
successful
trying to unbind the function from the submit event. I believe if it is
unbound when
the iframe_doc and iframe are removed at the end of the disable_design_mode
function
then I wouldn't see this problem.
Thanks
Original comment by gd.wing...@gmail.com
on 9 Mar 2009 at 9:28
Attachments:
will try to dig that problem more :( still can't reproduce. Aspx - ASP.NET?
Original comment by plandem
on 22 Mar 2009 at 11:28
[deleted comment]
It has been a while but I still wanted you to know we've ported over to MVC and
no
longer have this problem. I'm going to guess that we had some web control that
was
conflicting with this that when we rewrote it to use MVC it fixed the problem.
Thanks for your help.
Original comment by gd.wing...@gmail.com
on 1 Jun 2009 at 10:14
I had the same problem (aspx - WinForm).
Solved it like this:
lwRTE.prototype.enable_design_mode = function() {
...
/* added */
$(self.iframe).parents('form').unbind('submit');
/* original */
$(self.iframe).parents('form').submit(
function() { self.disable_design_mode(true); }
);
...
}
Original comment by goran.he...@gmail.com
on 20 Jun 2009 at 10:45
Thanks, that worked for me for the most part. I ended up just removing the
ability
to toggle to html mode just because my users really don't need that
functionality.
Unless it is already there and I'm just missing it, it would be nice to have the
ability to turn on and off the toggle button as an option to send to the
plug-in when
I create it.
Original comment by gd.wing...@gmail.com
on 11 Aug 2009 at 7:10
I don't understand why you placed the code to listing to the submit event of
the form
in the enable_design_mode method.
It would be better to place it in the constructor
...
var lwRTE = function (textarea, options) {
..
}
and attach to the form this way:
...
$j(textarea).parents('form').first()
.submit(function(){
...
Original comment by eamonnoc...@gmail.com
on 24 May 2010 at 3:09
Original issue reported on code.google.com by
gd.wing...@gmail.com
on 5 Mar 2009 at 7:52