mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX: Fix deleting folders in Internet Explorer (from r87390)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96780 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
00264e219c
commit
fdce9e045d
@ -87,7 +87,7 @@ MarkingPropertiesButton.prototype = {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// CheckBoxRange adapted from: http://jroller.com/page/rmcmahon?entry=checkboxrange_with_prototype
|
// CheckBoxRange adapted from: http://jroller.com/page/rmcmahon?entry=checkboxrange_with_prototype
|
||||||
@ -148,23 +148,23 @@ CheckBoxRange.prototype = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// SubsDraggable adapted from http://dev.rubyonrails.org/ticket/5771
|
// SubsDraggable adapted from http://dev.rubyonrails.org/ticket/5771
|
||||||
|
|
||||||
// extentions for scriptaculous dragdrop.js
|
// extentions for scriptaculous dragdrop.js
|
||||||
Object.extend(Class, {
|
Object.extend(Class, {
|
||||||
superrise: function(obj, names){
|
superrise: function(obj, names){
|
||||||
names.each( function(n){ obj['super_' + n] = obj[n] } )
|
names.each( function(n){ obj['super_' + n] = obj[n]; } );
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
// Draggable that allows substitution of draggable element
|
// Draggable that allows substitution of draggable element
|
||||||
var SubsDraggable = Class.create();
|
var SubsDraggable = Class.create();
|
||||||
|
|
||||||
SubsDraggable.prototype = Object.extend({}, Draggable.prototype);
|
SubsDraggable.prototype = Object.extend({}, Draggable.prototype);
|
||||||
Class.superrise(SubsDraggable.prototype, ['initialize', 'startDrag', 'finishDrag', 'endDrag'])
|
Class.superrise(SubsDraggable.prototype, ['initialize', 'startDrag', 'finishDrag', 'endDrag']);
|
||||||
Object.extend( SubsDraggable.prototype , {
|
Object.extend( SubsDraggable.prototype , {
|
||||||
initialize: function(event) {
|
initialize: function(event) {
|
||||||
this.super_initialize.apply(this, arguments);
|
this.super_initialize.apply(this, arguments);
|
||||||
@ -216,7 +216,7 @@ Object.extend( SubsDraggable.prototype , {
|
|||||||
this._originalElement = null;
|
this._originalElement = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
// gets element that should be dragged instead of original element
|
// gets element that should be dragged instead of original element
|
||||||
// returned element should be added to DOM tree, and will be deleted by dragdrop library
|
// returned element should be added to DOM tree, and will be deleted by dragdrop library
|
||||||
function getDragElement(element){
|
function getDragElement(element){
|
||||||
@ -238,7 +238,7 @@ DragFileItem.prototype = {
|
|||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.draggable = null;
|
this.draggable = null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
DragFileItem.applyTo('#Form_EditForm_Files tr td.dragfile');
|
DragFileItem.applyTo('#Form_EditForm_Files tr td.dragfile');
|
||||||
|
|
||||||
// Set up folder drop target
|
// Set up folder drop target
|
||||||
@ -267,7 +267,7 @@ DropFileItem.prototype = {
|
|||||||
if(checkboxes[i].checked) list += (list?',':'') + checkboxes[i].value;
|
if(checkboxes[i].checked) list += (list?',':'') + checkboxes[i].value;
|
||||||
}
|
}
|
||||||
$('Form_EditForm_FileIDs').value = list;
|
$('Form_EditForm_FileIDs').value = list;
|
||||||
$('Form_EditForm').save(false, null, 'movemarked')
|
$('Form_EditForm').save(false, null, 'movemarked');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -275,7 +275,7 @@ DropFileItem.prototype = {
|
|||||||
this.droppable = null;
|
this.droppable = null;
|
||||||
this.recordID = null;
|
this.recordID = null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
DropFileItem.applyTo('#sitetree li');
|
DropFileItem.applyTo('#sitetree li');
|
||||||
|
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ addfolder.prototype = {
|
|||||||
showAddPageError: function(response) {
|
showAddPageError: function(response) {
|
||||||
errorMessage('Error adding folder', response);
|
errorMessage('Error adding folder', response);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look for new files (FilesystemSync) action
|
* Look for new files (FilesystemSync) action
|
||||||
@ -352,7 +352,7 @@ FilesystemSyncClass.prototype = {
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete folder action
|
* Delete folder action
|
||||||
@ -367,7 +367,7 @@ var deletefolder = {
|
|||||||
|
|
||||||
deletefolder.selectedNodes = { };
|
deletefolder.selectedNodes = { };
|
||||||
|
|
||||||
var sel = $('sitetree').firstSelected()
|
var sel = $('sitetree').firstSelected();
|
||||||
if(sel) {
|
if(sel) {
|
||||||
var selIdx = $('sitetree').getIdxOf(sel);
|
var selIdx = $('sitetree').getIdxOf(sel);
|
||||||
deletefolder.selectedNodes[selIdx] = true;
|
deletefolder.selectedNodes[selIdx] = true;
|
||||||
@ -411,7 +411,7 @@ var deletefolder = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
form_submit : function() {
|
form_submit : function(e) {
|
||||||
var csvIDs = "";
|
var csvIDs = "";
|
||||||
for(var idx in deletefolder.selectedNodes) {
|
for(var idx in deletefolder.selectedNodes) {
|
||||||
var selectedNode = $('sitetree').getTreeNodeByIdx(idx);
|
var selectedNode = $('sitetree').getTreeNodeByIdx(idx);
|
||||||
@ -438,7 +438,8 @@ var deletefolder = {
|
|||||||
} else {
|
} else {
|
||||||
alert("Please select at least 1 page.");
|
alert("Please select at least 1 page.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Event.stop(e);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -446,7 +447,7 @@ var deletefolder = {
|
|||||||
Ajax.Evaluator(response);
|
Ajax.Evaluator(response);
|
||||||
treeactions.closeSelection($('deletepage'));
|
treeactions.closeSelection($('deletepage'));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
Behaviour.register({
|
Behaviour.register({
|
||||||
'#Form_EditForm_Files': {
|
'#Form_EditForm_Files': {
|
||||||
|
Loading…
Reference in New Issue
Block a user