mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Moved some form logic from AssetAdmin.js to AssetTableField.js
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92808 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f4e2dcb61a
commit
284de94770
@ -137,51 +137,3 @@ var _HANDLER_FORMS = {
|
||||
};
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
|
||||
Behaviour.register({
|
||||
'#Form_EditForm_Files': {
|
||||
removeFile : function(fileID) {
|
||||
var record;
|
||||
if(record = $('record-' + fileID)) {
|
||||
record.parentNode.removeChild(record);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'#Form_EditForm_Files a.deletelink' : {
|
||||
onclick : function(event) {
|
||||
// Send request
|
||||
new Ajax.Request(this.href + (this.href.indexOf("?") == -1 ? "?" : "&") + "ajax=1", {
|
||||
method : 'get',
|
||||
onSuccess : Ajax.Evaluator,
|
||||
onFailure : function(response) {errorMessage('Server Error', response);}
|
||||
});
|
||||
Event.stop(event);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'#Form_EditForm' : {
|
||||
changeDetection_fieldsToIgnore : {
|
||||
'Files[]' : true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* We don't want hitting the enter key in the name field
|
||||
* to submit the form.
|
||||
*/
|
||||
Behaviour.register({
|
||||
'#Form_EditForm_Name' : {
|
||||
onkeypress : function(event) {
|
||||
event = (event) ? event : window.event;
|
||||
var kc = event.keyCode ? event.keyCode : event.charCode;
|
||||
if(kc == 13) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -136,3 +136,34 @@ MarkingPropertiesButton.prototype = {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Behaviour.register({
|
||||
'#Form_EditForm_Files': {
|
||||
removeFile : function(fileID) {
|
||||
var record;
|
||||
if(record = $('record-' + fileID)) {
|
||||
record.parentNode.removeChild(record);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'#Form_EditForm_Files a.deletelink' : {
|
||||
onclick : function(event) {
|
||||
// Send request
|
||||
new Ajax.Request(this.href + (this.href.indexOf("?") == -1 ? "?" : "&") + "ajax=1", {
|
||||
method : 'get',
|
||||
onSuccess : Ajax.Evaluator,
|
||||
onFailure : function(response) {errorMessage('Server Error', response);}
|
||||
});
|
||||
Event.stop(event);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'#Form_EditForm' : {
|
||||
changeDetection_fieldsToIgnore : {
|
||||
'Files[]' : true
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user