EasyUI Forum

General Category => Bug Report => Topic started by: BegeMode on April 22, 2013, 11:52:03 PM



Title: draggable init bug
Post by: BegeMode on April 22, 2013, 11:52:03 PM
create a draggable element that initially he disabled.

Code:
$('.selector').draggable({
                            revert:true,
                            disabled: true,
                            proxy: .....
                            .......
                        });
if the 'disabled == true', $.data(this, "draggable") is empty, see fragment of code:

Code:
if(_32.disabled==true){
$(this).css("cursor","");
return;
}
var _34=null;
if(typeof _32.handle=="undefined"||_32.handle==null){
_34=$(this);
}else{
_34=(typeof _32.handle=="string"?$(_32.handle,this):_32.handle);
}
$.data(this,"draggable",{options:_32,handle:_34});

then I make it enabled, event handlers and proxy need to be defined again


Title: Re: draggable init bug
Post by: BegeMode on May 07, 2013, 11:32:56 PM
if initially draggable element is disabled, it is not initialised !!!
why is this happening can be seen from the source:

Code:
	$.fn.draggable = function(options, param){
if (typeof options == 'string'){
return $.fn.draggable.methods[options](this, param);
}
....................

if (opts.disabled == true) {
$(this).css('cursor', '');
// $(this).css('cursor', 'default');
return;
}
.....................

initialization occurs below:
Code:
var handle = null;
            if (typeof opts.handle == 'undefined' || opts.handle == null){
                handle = $(this);
            } else {
                handle = (typeof opts.handle == 'string' ? $(opts.handle, this) : opts.handle);
            }
$.data(this, 'draggable', {
options: opts,
handle: handle
});
this is bug or feature?


Title: Re: draggable init bug
Post by: BegeMode on May 30, 2013, 06:59:00 AM
no reaction ((((
EasyUI a good framework, but the lack of response to the detected errors can not make it better (((


Title: Re: draggable init bug
Post by: stworthy on May 30, 2013, 08:24:48 PM
This issue has been fixed, the updated draggable plugin can be downloaded from http://www.jeasyui.com/easyui/plugins/jquery.draggable.js.