mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX #83 Disable Finish button + add spinner while uploading
This commit is contained in:
parent
c72310ff61
commit
4a349987a4
@ -143,4 +143,11 @@
|
|||||||
margin: 0 6px 0 6px;
|
margin: 0 6px 0 6px;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
color: #ffffff; }
|
color: #ffffff;
|
||||||
|
background-image: url(../../images/spinner.gif);
|
||||||
|
background-position: 0 -50px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
overflow: hidden; }
|
||||||
|
.bulkUpload .component div.ss-uploadfield .colymba-bulkupload-buttons.loading .colymba-bulkupload-info {
|
||||||
|
padding-left: 20px;
|
||||||
|
background-position: 0 5px; }
|
||||||
|
@ -283,6 +283,21 @@
|
|||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
|
|
||||||
|
background-image: url(../../images/spinner.gif);
|
||||||
|
background-position: 0 -50px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.loading
|
||||||
|
{
|
||||||
|
.colymba-bulkupload-info
|
||||||
|
{
|
||||||
|
padding-left: 20px;
|
||||||
|
background-position: 0 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,8 +96,22 @@
|
|||||||
));
|
));
|
||||||
|
|
||||||
$cancelBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
$cancelBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
||||||
$finishBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
|
||||||
|
|
||||||
|
//if there are still uploads going
|
||||||
|
if ( (done + error) < total )
|
||||||
|
{
|
||||||
|
if ( !this.hasClass('loading') )
|
||||||
|
{
|
||||||
|
this.addClass('loading');
|
||||||
|
$finishBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.removeClass('loading');
|
||||||
|
$finishBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
//if all done and OK, enable edit
|
||||||
if ( total === done )
|
if ( total === done )
|
||||||
{
|
{
|
||||||
$editBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
$editBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
||||||
@ -106,6 +120,7 @@
|
|||||||
$editBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
$editBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//toggle clear error button
|
||||||
if ( error > 0 )
|
if ( error > 0 )
|
||||||
{
|
{
|
||||||
$clearErrorBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
$clearErrorBtn.removeClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'false').removeAttr('disabled');
|
||||||
@ -115,7 +130,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.css({display: 'none'});
|
//if not uploading, reset + hide
|
||||||
|
this.css({display: 'none'}).removeClass('loading');
|
||||||
$editBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
$editBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
||||||
$cancelBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
$cancelBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
||||||
$finishBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
$finishBtn.addClass('ui-state-disabled ssui-button-disabled').attr('aria-disabled', 'true').attr('disabled', 'true');
|
||||||
@ -128,7 +144,7 @@
|
|||||||
/**
|
/**
|
||||||
* Clears all updloads with warning or error
|
* Clears all updloads with warning or error
|
||||||
*/
|
*/
|
||||||
$('.bulkUploadClearErrorButton').entwine({
|
$('.bulkUploadClearErrorButton:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
this.removeClass('action');
|
this.removeClass('action');
|
||||||
},
|
},
|
||||||
@ -150,7 +166,7 @@
|
|||||||
* Cancel all uploads
|
* Cancel all uploads
|
||||||
* Clear the ones with warnings/error and delete dataObjects from the successful ones
|
* Clear the ones with warnings/error and delete dataObjects from the successful ones
|
||||||
*/
|
*/
|
||||||
$('.bulkUploadCancelButton').entwine({
|
$('.bulkUploadCancelButton:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
this.removeClass('action');
|
this.removeClass('action');
|
||||||
},
|
},
|
||||||
@ -213,7 +229,7 @@
|
|||||||
/**
|
/**
|
||||||
* Clear all the warning/error/finished uploads
|
* Clear all the warning/error/finished uploads
|
||||||
*/
|
*/
|
||||||
$('.bulkUploadFinishButton').entwine({
|
$('.bulkUploadFinishButton:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
this.removeClass('action');
|
this.removeClass('action');
|
||||||
},
|
},
|
||||||
@ -236,7 +252,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.bulkUploadEditButton').entwine({
|
$('.bulkUploadEditButton:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
this.removeClass('action');
|
this.removeClass('action');
|
||||||
},
|
},
|
||||||
|
BIN
images/spinner.gif
Normal file
BIN
images/spinner.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue
Block a user