support drag and drop
This commit is contained in:
parent
2cbcc9e7dd
commit
25c24d6f20
4 changed files with 121 additions and 2 deletions
|
|
@ -93,6 +93,25 @@
|
|||
Ox.$window.on({
|
||||
resize: oml.resizeWindow
|
||||
});
|
||||
Ox.$document.on({
|
||||
dragenter: function(event) {
|
||||
event.preventDefault();
|
||||
},
|
||||
dragover: function(event) {
|
||||
event.preventDefault();
|
||||
},
|
||||
drop: function(event) {
|
||||
if (event.originalEvent.dataTransfer.files) {
|
||||
event.preventDefault();
|
||||
oml.upload(event.originalEvent.dataTransfer.files, function(response) {
|
||||
setTimeout(function() {
|
||||
oml.UI.set({listSelection: response.data.ids});
|
||||
oml.reloadList();
|
||||
}, 50);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
oml.$ui.appPanel = oml.ui.appPanel().appendTo(Ox.$body);
|
||||
oml.$ui.loadingIcon.updateElement(Ox.Request.requests());
|
||||
Ox.Request.bindEvent({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue