mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +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,7 +405,8 @@ $(document).ready( function() {
|
|||
} else {
|
||||
url += "&"+param1;
|
||||
}
|
||||
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>');
|
||||
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>');
|
||||
$.get(url, function(data) {
|
||||
element.html(data);
|
||||
$(".chzn-select").select2({
|
||||
|
@ -571,7 +572,7 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
processData: false,
|
||||
cache: false,
|
||||
data: formData,
|
||||
success: function(data){
|
||||
success: function(data, textStatus) {
|
||||
status.setProgress(100);
|
||||
if(data.success) {
|
||||
noty({
|
||||
|
@ -707,26 +708,25 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */
|
||||
|
||||
$(document).ready(function() { /* {{{ */
|
||||
var obj = $("#dragandrophandler");
|
||||
obj.on('dragenter', function (e) {
|
||||
$(document).on('dragenter', "#dragandrophandler", function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$(this).css('border', '2px dashed #0B85A1');
|
||||
});
|
||||
obj.on('dragleave', function (e) {
|
||||
$(document).on('dragleave', "#dragandrophandler", function (e) {
|
||||
$(this).css('border', '0px solid white');
|
||||
});
|
||||
obj.on('dragover', function (e) {
|
||||
$(document).on('dragover', "#dragandrophandler", function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
obj.on('drop', function (e) {
|
||||
$(document).on('drop', "#dragandrophandler", function (e) {
|
||||
$(this).css('border', '0px dotted #0B85A1');
|
||||
e.preventDefault();
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
|
||||
//We need to send dropped files to Server
|
||||
SeedDMSUpload.handleFileUpload(files,obj, obj);
|
||||
SeedDMSUpload.handleFileUpload(files, $(this), $(this));
|
||||
});
|
||||
|
||||
$(document).on('dragenter', '.droptarget', function (e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user