in partnership with mediatemple

Changeset 1525

Show
Ignore:
Timestamp:
04/07/08 22:14:00 (1 month ago)
Author:
kamicane
Message:
  • added a preventDefault option to Drag, defaulting to false. if its true, the event will run its preventDefault method. this fixes #870 (if the option is set to true). If you set the options to true, it will be impossible to select form elements or execute links inside draggable elements.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Source/Plugins/Drag.js

    r1485 r1525  
    2424                handle: false, 
    2525                invert: false, 
     26                preventDefault: false, 
    2627                modifiers: {x: 'left', y: 'top'} 
    2728        }, 
     
    6162 
    6263        start: function(event){ 
     64                if (this.options.preventDefault) event.preventDefault(); 
    6365                this.fireEvent('onBeforeStart', this.element); 
    6466                this.mouse.start = event.page; 
     
    8385 
    8486        check: function(event){ 
     87                if (this.options.preventDefault) event.preventDefault(); 
    8588                var distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2))); 
    8689                if (distance > this.options.snap){ 
     
    9598 
    9699        drag: function(event){ 
     100                if (this.options.preventDefault) event.preventDefault(); 
    97101                this.mouse.now = event.page; 
    98102                for (var z in this.options.modifiers){