ugly workaround to fix jQuery UI vs. IE8 bug
This commit is contained in:
parent
8723504185
commit
9c577211fd
@ -103,13 +103,26 @@ function wtrash() {
|
|||||||
},
|
},
|
||||||
'drop' : function(event, ui) {
|
'drop' : function(event, ui) {
|
||||||
var parent=ui.draggable.parent();
|
var parent=ui.draggable.parent();
|
||||||
$(ui.draggable).fadeOut().remove(); // error in IE8
|
var draggable = $(ui.draggable);
|
||||||
// $(ui.draggable).fadeOut(); // will fade, will remove, graphic glitches
|
|
||||||
|
// we can't remove() draggable here, because of a bug with jquery UI + IE8
|
||||||
|
// we'll defer it
|
||||||
|
draggable.fadeOut();
|
||||||
$('.widget-dragger').remove();
|
$('.widget-dragger').remove();
|
||||||
if(parent.children().length<1) {
|
|
||||||
|
// last element has not been removed,
|
||||||
|
// so there is still one in the list, soon to be deleted '
|
||||||
|
// (parent.children().lenght==1)
|
||||||
|
if(parent.children().length<2) {
|
||||||
parent.append('<li class="widget-placeholder">Drop here</li>');
|
parent.append('<li class="widget-placeholder">Drop here</li>');
|
||||||
}
|
}
|
||||||
$(this).animate({'background-color' : '#a22'});
|
$(this).animate({'background-color' : '#a22'});
|
||||||
|
|
||||||
|
// deferred removal takes place here
|
||||||
|
setTimeout(function() {
|
||||||
|
draggable.remove();
|
||||||
|
});
|
||||||
|
|
||||||
wreload();
|
wreload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -119,6 +132,7 @@ function wreload(){
|
|||||||
winstancedrag();
|
winstancedrag();
|
||||||
wplaceholder();
|
wplaceholder();
|
||||||
winstancedrop();
|
winstancedrop();
|
||||||
wtrash();
|
//wtrash();
|
||||||
}
|
}
|
||||||
$(document).ready(wreload);
|
//$(document).ready(wreload);
|
||||||
|
wreload();wtrash();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user