mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 14:11:35 +00:00
check for data-no-spinner, make drag&drop work if loaded by ajax
This commit is contained in:
parent
712a504d9b
commit
aed406b167
|
@ -405,6 +405,7 @@ $(document).ready( function() {
|
||||||
} else {
|
} else {
|
||||||
url += "&"+param1;
|
url += "&"+param1;
|
||||||
}
|
}
|
||||||
|
if(!element.data('no-spinner'))
|
||||||
element.prepend('<div style="position: absolute; overflow: hidden; background: #f7f7f7; z-index: 1000; height: '+element.height()+'px; width: '+element.width()+'px; opacity: 0.7; display: table;"><div style="display: table-cell;text-align: center; vertical-align: middle; "><img src="../views/bootstrap/images/ajax-loader.gif"></div>');
|
element.prepend('<div style="position: absolute; overflow: hidden; background: #f7f7f7; z-index: 1000; height: '+element.height()+'px; width: '+element.width()+'px; opacity: 0.7; display: table;"><div style="display: table-cell;text-align: center; vertical-align: middle; "><img src="../views/bootstrap/images/ajax-loader.gif"></div>');
|
||||||
$.get(url, function(data) {
|
$.get(url, function(data) {
|
||||||
element.html(data);
|
element.html(data);
|
||||||
|
@ -571,7 +572,7 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
processData: false,
|
processData: false,
|
||||||
cache: false,
|
cache: false,
|
||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data, textStatus) {
|
||||||
status.setProgress(100);
|
status.setProgress(100);
|
||||||
if(data.success) {
|
if(data.success) {
|
||||||
noty({
|
noty({
|
||||||
|
@ -707,26 +708,25 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */
|
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */
|
||||||
|
|
||||||
$(document).ready(function() { /* {{{ */
|
$(document).ready(function() { /* {{{ */
|
||||||
var obj = $("#dragandrophandler");
|
$(document).on('dragenter', "#dragandrophandler", function (e) {
|
||||||
obj.on('dragenter', function (e) {
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).css('border', '2px dashed #0B85A1');
|
$(this).css('border', '2px dashed #0B85A1');
|
||||||
});
|
});
|
||||||
obj.on('dragleave', function (e) {
|
$(document).on('dragleave', "#dragandrophandler", function (e) {
|
||||||
$(this).css('border', '0px solid white');
|
$(this).css('border', '0px solid white');
|
||||||
});
|
});
|
||||||
obj.on('dragover', function (e) {
|
$(document).on('dragover', "#dragandrophandler", function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
obj.on('drop', function (e) {
|
$(document).on('drop', "#dragandrophandler", function (e) {
|
||||||
$(this).css('border', '0px dotted #0B85A1');
|
$(this).css('border', '0px dotted #0B85A1');
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var files = e.originalEvent.dataTransfer.files;
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
|
||||||
//We need to send dropped files to Server
|
//We need to send dropped files to Server
|
||||||
SeedDMSUpload.handleFileUpload(files,obj, obj);
|
SeedDMSUpload.handleFileUpload(files, $(this), $(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('dragenter', '.droptarget', function (e) {
|
$(document).on('dragenter', '.droptarget', function (e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user