This project is archived and is in readonly mode.

#62 ✓resolved
Thomas Aylott

Dragging only works for firefox in trunk-r1537

Reported by Thomas Aylott | May 28th, 2008 @ 10:06 AM

Originally posted on Trac by valmarv

Original Trac Ticket

Description

Js error when trying to drag in ie or opera.

Test url:

http://webimagefactory.com/dev/m...

Trac Attachments

Trac Comments

Changed 1 month ago by valmarv


        
great work by the way, mootools is simply amazing... 

      

Changed 1 month ago by kamicane


        
duplicate of #974 

                  Changed 1 month ago by kamicane

          status
              changed from new to closed
        
          resolution
              set to duplicate

duplicate of #974 

          status
              changed from new to closed
        
          resolution
              set to duplicate
        
      

Changed 1 month ago by valmarv


        
I might be wrong but this has nothing to do with bug #974 and it hasn't been solved in r1537. I repeat, the dragging only works for firefox... 
I did some debugging on my own and found the error here (class Drag, method drag, line 4177 - setStyle - this crashes both ie6, ie7 and opera): 

drag: function(event){
	if (this.options.preventDefault) event.preventDefault();
	this.mouse.now = event.page;
	for (var z in this.options.modifiers){
		if (!this.options.modifiers[z]) continue;
		this.value.now[z] = this.mouse.now[z] - this.mouse.pos[z];
		if (this.options.invert) this.value.now[z] *= -1;
		if (this.options.limit && this.limit[z]){
			if ($chk(this.limit[z][1]) && (this.value.now[z] > this.limit[z][1])){
				this.value.now[z] = this.limit[z][1];
			} else if ($chk(this.limit[z][0]) && (this.value.now[z] 
tested with r1537 
test url: http://webimagefactory.com/dev/m... 

                  Changed 1 month ago by valmarv

          status
              changed from closed to reopened
        
          resolution
            deleted
        
          summary
              changed from Dragging only works for firefox in trunk-r1536 to Dragging only works for firefox in trunk-r1537

I might be wrong but this has nothing to do with bug #974 and it hasn't been solved in r1537. I repeat, the dragging only works for firefox... 
I did some debugging on my own and found the error here (class Drag, method drag, line 4177 - setStyle - this crashes both ie6, ie7 and opera): 

drag: function(event){
	if (this.options.preventDefault) event.preventDefault();
	this.mouse.now = event.page;
	for (var z in this.options.modifiers){
		if (!this.options.modifiers[z]) continue;
		this.value.now[z] = this.mouse.now[z] - this.mouse.pos[z];
		if (this.options.invert) this.value.now[z] *= -1;
		if (this.options.limit && this.limit[z]){
			if ($chk(this.limit[z][1]) && (this.value.now[z] > this.limit[z][1])){
				this.value.now[z] = this.limit[z][1];
			} else if ($chk(this.limit[z][0]) && (this.value.now[z] 
tested with r1537 
test url: http://webimagefactory.com/dev/m... 

          status
              changed from closed to reopened
        
          resolution
            deleted
        
          summary
              changed from Dragging only works for firefox in trunk-r1536 to Dragging only works for firefox in trunk-r1537
        
      

Changed 1 month ago by kasi


        
Add top:0;left:0 to the element style and it works in IE 

KASI 

      

Changed 1 month ago by valmarv


        
Thanks, that did it indeed, so dragging requires the element to be absolutely positioned first. 
One more aspect if you please, dragging in IE is more like a start drag - stick around - click to release thing. Is that normal? 

      

Changed 1 month ago by digitarald


        
valmarv: Use the Drag preventDefault option, its needed on special elements like images to prevent that behaviour for IE 

      

Changed 1 month ago by valmarv


        
thank you, digitarald, great tip. it does a good job for regular object dragging but it doesn't cure sortables dragging though... 

      

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Tags

Pages