Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] RTE backspace question.

Expand Messages
  • Dav Glass
    Ethan -- The reason that the cursor jumps into the DIV is that it can t have invalid HTML so instead of deleting the closing tag, it will jump into it. Then
    Message 1 of 2 , May 2, 2008
    View Source
    • 0 Attachment
      Ethan --

      The reason that the cursor jumps into the DIV is that it can't have invalid HTML so instead of deleting the closing tag, it will jump into it. Then when it reaches the beginning of the DIV tag, it will then delete the DIV.. Make sense?

      However, you could try to use the allowNoEdit config option:
      http://developer.yahoo.com/yui/docs/YAHOO.widget.SimpleEditor.html#config_allowNoEdit

      You will need to add it to the config for the editor like this:

      var myEditor = new YAHOO.widget.Editor('editor', {
      allowNoEdit: true
      });


      Then in the HTML that you are putting into the editor, add this class to the outer element:
      yui-noedit

      Does that help?
      Dav

      Dav Glass
      dav.glass@...
      blog.davglass.com




      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
      without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
      McDonalds Certified Food Specialist is to fine cuisine +


      ----- Original Message ----
      From: Ethan Lance <ethanlance@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Friday, May 2, 2008 10:22:31 AM
      Subject: [ydn-javascript] RTE backspace question.

      Hey Dav:

      I modified the image insert function to insert HTML into the editor,
      which works perfectly. The HTML around each inserted image looks like
      this...

      <DIV class=js-item-cage id=350286 rel="image">
      <DIV class=wiki-img-left>
      <DIV class=wiki-img-medium><A title=""
      href="http://localhost:8000/6/69-350286/"><IMG id=350286 alt=""
      src="http://media.comicvine.com/uploads/0/4/350286-6_medium.jpg"></A>
      <DIV class="item-caption p-4">caption</DIV>
      </DIV>
      </DIV>
      </DIV>

      My problem is when the cursor is to the right of this div, when I
      backspace (to delete this div and it's contents), the cursor actually
      moves inside the div with class=item-caption... and then just starts
      deleting the text inside that caption div.

      How can I get the backspace to just take out this entire div structure
      instead of jumping inside of it?

      Thanks,

      Ethan Lance
      www.comicvine.com


      ------------------------------------

      Yahoo! Groups Links
    Your message has been successfully submitted and would be delivered to recipients shortly.