mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Add ui-state to save and delete buttons
Switch buttons between enabled and disabled as necessary
This commit is contained in:
parent
a0ebac8f7d
commit
67958b4e37
@ -166,6 +166,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
|||||||
->setAttribute('data-icon', 'accept')
|
->setAttribute('data-icon', 'accept')
|
||||||
->setAttribute('data-url', $this->Link('update'))
|
->setAttribute('data-url', $this->Link('update'))
|
||||||
->setUseButtonTag(true)
|
->setUseButtonTag(true)
|
||||||
|
->setDisabled(true)
|
||||||
);
|
);
|
||||||
/*
|
/*
|
||||||
if($crumbs && $crumbs->count()>=2)
|
if($crumbs && $crumbs->count()>=2)
|
||||||
@ -188,6 +189,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
|||||||
->setAttribute('data-icon', 'decline')
|
->setAttribute('data-icon', 'decline')
|
||||||
->setAttribute('data-url', $this->Link('cancel'))
|
->setAttribute('data-url', $this->Link('cancel'))
|
||||||
->setUseButtonTag(true)
|
->setUseButtonTag(true)
|
||||||
|
->setDisabled(true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
if( !$(this).hasClass('opened') ){
|
if( !$(this).hasClass('opened') ){
|
||||||
$(this).addClass('opened');
|
$(this).addClass('opened');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onunmatch: function(){
|
onunmatch: function(){
|
||||||
|
|
||||||
@ -63,10 +63,11 @@
|
|||||||
if ( !$(itemInfo).hasClass('dirty') ) $(itemInfo).addClass('dirty');
|
if ( !$(itemInfo).hasClass('dirty') ) $(itemInfo).addClass('dirty');
|
||||||
|
|
||||||
$('#bulkImageUploadUpdateFinishBtn').addClass('dirty');
|
$('#bulkImageUploadUpdateFinishBtn').addClass('dirty');
|
||||||
|
$('#bulkImageUploadUpdateBtn').removeClass('ui-state-disabled');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#bulkImageUploadUpdateBtn').entwine({
|
$('#bulkImageUploadUpdateBtn:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
$(this).data('completedForms', 0);
|
$(this).data('completedForms', 0);
|
||||||
},
|
},
|
||||||
@ -114,10 +115,11 @@
|
|||||||
$('#bulkImageUploadUpdateFinishBtn').removeClass('dirty');
|
$('#bulkImageUploadUpdateFinishBtn').removeClass('dirty');
|
||||||
$('#bulkImageUploadUpdateBtn').data('completedForms', 0);
|
$('#bulkImageUploadUpdateBtn').data('completedForms', 0);
|
||||||
$('#bulkImageUploadUpdateBtn').removeClass('loading');
|
$('#bulkImageUploadUpdateBtn').removeClass('loading');
|
||||||
|
$('#bulkImageUploadUpdateBtn').addClass('ui-state-disabled');
|
||||||
if ( $('#bulkImageUploadUpdateBtn').hasClass('doFinish') ) {
|
if ( $('#bulkImageUploadUpdateBtn').hasClass('doFinish') ) {
|
||||||
//@TODO find a way to pass this as CMS navigation through AJAX
|
//@TODO find a way to pass this as CMS navigation through AJAX
|
||||||
window.location = $('#bulkImageUploadUpdateFinishBtn').data('return-url');
|
window.location = $('#bulkImageUploadUpdateFinishBtn').data('return-url');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -135,7 +137,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#bulkImageUploadUpdateCancelBtn').entwine({
|
$('.ss-uploadfield-item-editform').entwine({
|
||||||
|
onmatch: function(e){
|
||||||
|
console.log(this);
|
||||||
|
$('#bulkImageUploadUpdateCancelBtn').removeClass('ui-state-disabled');
|
||||||
|
},
|
||||||
|
onunmatch: function(){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#bulkImageUploadUpdateCancelBtn:not(.ui-state-disabled)').entwine({
|
||||||
onclick: function(e){
|
onclick: function(e){
|
||||||
|
|
||||||
var url = $(this).data('url');
|
var url = $(this).data('url');
|
||||||
@ -156,6 +167,7 @@
|
|||||||
if ( $('li.ss-uploadfield-item').length == 0 ) {
|
if ( $('li.ss-uploadfield-item').length == 0 ) {
|
||||||
$('.ss-uploadfield-editandorganize').css('display', 'none');
|
$('.ss-uploadfield-editandorganize').css('display', 'none');
|
||||||
$('#Form_bulkImageUploadForm').removeClass('loading');
|
$('#Form_bulkImageUploadForm').removeClass('loading');
|
||||||
|
$('#bulkImageUploadUpdateCancelBtn').addClass('ui-state-disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user