In my dragdrop.js file there is a line (can’t remember if I added it or if it was there to begin with, lol) that prevents text selection while dragging a Draggable object... you could use something similar at a global level if you don't just want to limit the behavior to Draggables.

 

The register() method of "Draggables" looks like this...

 

register: function(draggable) {

    if(this.drags.length == 0) {

      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);

      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);

      this.eventKeypress  = this.keyPress.bindAsEventListener(this);

     

      Event.observe(document, "mouseup", this.eventMouseUp);

      Event.observe(document, "mousemove", this.eventMouseMove);

      Event.observe(document, "keypress", this.eventKeypress);

     

      // prevent text selection while dragging.

      document. = function() { return this.activeDraggable == null; }.bind(this);

    }

    this.drags.push(draggable);

  },

 

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Aneesha Bakharia
Sent: Thursday, March 02, 2006 3:54 AM
To: Rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] Hey How did they do that?

 

I've seen web apps where cells within a table column can be highlighted by dragging over them. NumSum does this. Any ideas on how this is achieved? When I try to select cells in a column by dragging over them the text within rows gets selected as well.

Take Care

--
Aneesha

The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to