Giter Site home page Giter Site logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 5 Mar 2009 at 8:00

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
have you tried last version?

Original comment by plandem on 9 Mar 2009 at 3:03

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 9 Mar 2009 at 9:28

Attachments:

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
[deleted comment]

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 1 Jun 2009 at 10:14

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 20 Jun 2009 at 10:45

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 11 Aug 2009 at 7:10

from lwrte.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 19, 2024
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 [email protected] on 24 May 2010 at 3:09

from lwrte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.