mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX: Cleanup after aborted drag operation in Assets (#4735) (from r93071)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@94319 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
233690b24d
commit
2eea820daf
@ -164,7 +164,7 @@ Object.extend(Class, {
|
||||
var SubsDraggable = Class.create();
|
||||
|
||||
SubsDraggable.prototype = Object.extend({}, Draggable.prototype);
|
||||
Class.superrise(SubsDraggable.prototype, ['initialize', 'startDrag', 'finishDrag'])
|
||||
Class.superrise(SubsDraggable.prototype, ['initialize', 'startDrag', 'finishDrag', 'endDrag'])
|
||||
Object.extend( SubsDraggable.prototype , {
|
||||
initialize: function(event) {
|
||||
this.super_initialize.apply(this, arguments);
|
||||
@ -198,6 +198,15 @@ Object.extend( SubsDraggable.prototype , {
|
||||
}
|
||||
this.super_startDrag(event);
|
||||
},
|
||||
endDrag: function(event) {
|
||||
this.super_endDrag(event);
|
||||
// Remove any remaining orphaned NumFilesIndicator spans
|
||||
// See ticket #4735
|
||||
var elts = $$('.NumFilesIndicator')
|
||||
if (elts) {
|
||||
elts.each(function(x){ Element.remove(x); });
|
||||
}
|
||||
},
|
||||
finishDrag: function(event, success) {
|
||||
this.super_finishDrag(event, success);
|
||||
|
||||
@ -348,7 +357,7 @@ FilesystemSyncClass.prototype = {
|
||||
/**
|
||||
* Delete folder action
|
||||
*/
|
||||
deletefolder = {
|
||||
var deletefolder = {
|
||||
button_onclick : function() {
|
||||
if(treeactions.toggleSelection(this)) {
|
||||
deletefolder.o1 = $('sitetree').observeMethod('SelectionChanged', deletefolder.treeSelectionChanged);
|
||||
@ -490,7 +499,15 @@ appendLoader(function () {
|
||||
if($('deletepage')) {
|
||||
$('deletepage').onclick = deletefolder.button_onclick;
|
||||
$('deletepage').getElementsByTagName('button')[0].onclick = function() { return false; };
|
||||
$('Form_DeleteItemsForm').onsubmit = deletefolder.form_submit;
|
||||
// Prevent bug #4740, particularly with IE
|
||||
Behaviour.register({
|
||||
'#Form_DeleteItemsForm' : {
|
||||
onsubmit: function(event) {
|
||||
deletefolder.form_submit();
|
||||
Event.stop(event);
|
||||
}
|
||||
}
|
||||
});
|
||||
Element.hide('Form_DeleteItemsForm');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user