EasyUI Forum
May 05, 2024, 01:24:01 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: draggable init bug  (Read 12659 times)
BegeMode
Newbie
*
Posts: 6


View Profile
« 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
« Last Edit: April 23, 2013, 07:04:19 AM by BegeMode » Logged
BegeMode
Newbie
*
Posts: 6


View Profile
« Reply #1 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?
Logged
BegeMode
Newbie
*
Posts: 6


View Profile
« Reply #2 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 (((
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!