Skip to content
Permalink
Browse files

Minorl performance improvements at draggable init

  • Loading branch information
eduardolundgren committed Jul 10, 2008
1 parent 45bb23e commit 184f890e069cd0225911db5724894b31bbd00927
Showing with 9 additions and 3 deletions.
  1. +9 −3 ui/ui.draggable.js
@@ -16,11 +16,17 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
init: function() {

//Initialize needed constants
var o = this.options;
var o = this.options, positioned = /^(?:r|a|f)/, element = this.element[0];

if (!this.element.length)
return false;

var style = element.style || {},
position = style.position || "static";

//Position the node
if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
this.element.css('position', 'relative');
if (o.helper == 'original' && !positioned.test(position))
style.position = 'relative';

this.element.addClass('ui-draggable');
(o.disabled && this.element.addClass('ui-draggable-disabled'));

0 comments on commit 184f890

Please sign in to comment.
You can’t perform that action at this time.