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

Re: yui-tmp improvement?

Expand Messages
  • stein.dave@ymail.com
    After I posted I ve taken a look deeper. I understand why you re using execCommand better now. You can t really select the text another way to even put an
    Message 1 of 3 , Jun 30, 2009
    • 0 Attachment
      After I posted I've taken a look deeper. I understand why you're using execCommand better now. You can't really select the text another way to even put an attribute on it. I've been spending time trying to use the anchor and focus nodes to get the selection to wrap a span around it and then selectNode() on it. I've gotten real close but it's not perfect yet. I'm going to give it some time and let you know if I find a solution. The trickiest thing is if you select half a textNode inside an element and cross over to another element.

      --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
      > The problem that yui-tmp solves is that I have to interact with the
      > selection. You can't do that with your approach.
      > If you have a valid test case with an improvement, please file a ticket
      > for it and attach it.
      > Dav
      > On Mon, 29 Jun 2009, stein.dave@... wrote:
      > > I am making the color picker be a gradient slider, instead of clicking from a palette. I noticed while I drag on my picker to change the color of the font, the font-family flickers. It becomes more noticeable as the font becomes larger. This is due to the execCommand workaround in _createCurrentElement(). I was thinking a less obtrusive thing to look for would be a fake attribute. Something like this works down to IE6...
      > >
      > > <div id="tester">
      > >
      > > </div>
      > >
      > > <script type="text/javascript">
      > > document.getElementById('tester').setAttribute('selecting','yes');
      > > alert(document.getElementById('tester').getAttribute('selecting'));
      > > </script>
      > >
      > > That way you can look for the element without changing any CSS rules - even for an instant.
      > >
      > > Thoughts?
      > >
      > --
      > Dav Glass
      > davglass@...
      > 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 +
    Your message has been successfully submitted and would be delivered to recipients shortly.