mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 09:05:57 +00:00
fix HtmlEditorField changes not being cought
also centralise change function for each item edit form
This commit is contained in:
parent
3d344f4db5
commit
2cc9a999f9
@ -46,16 +46,19 @@
|
|||||||
|
|
||||||
$.entwine('colymba', function($) {
|
$.entwine('colymba', function($) {
|
||||||
|
|
||||||
$('.bulkImageUploadUpdateForm input.text, .bulkImageUploadUpdateForm input.checkbox, .bulkImageUploadUpdateForm select, .bulkImageUploadUpdateForm textarea').entwine({
|
$('.bulkImageUploadUpdateForm').entwine({
|
||||||
onchange: function(){
|
onmatch: function(){
|
||||||
var form, itemInfo, itemStatus;
|
},
|
||||||
|
onunmatch: function(){
|
||||||
|
},
|
||||||
|
haschanged: function(){
|
||||||
|
var itemInfo, itemStatus;
|
||||||
|
|
||||||
form = this.closest('.bulkImageUploadUpdateForm');
|
itemStatus = $(this).parents('li').find('.ss-uploadfield-item-status');
|
||||||
itemStatus = (this).parents('li').find('.ss-uploadfield-item-status');
|
|
||||||
itemInfo = $(this).parents('li').find('.ss-uploadfield-item-info');
|
itemInfo = $(this).parents('li').find('.ss-uploadfield-item-info');
|
||||||
|
|
||||||
if ( !$(form).hasClass('hasUpdate') ) {
|
if ( !$(this).hasClass('hasUpdate') ) {
|
||||||
$(form).addClass('hasUpdate');
|
$(this).addClass('hasUpdate');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(itemStatus).removeClass('updated').addClass('dirty').html('Changed');
|
$(itemStatus).removeClass('updated').addClass('dirty').html('Changed');
|
||||||
@ -67,6 +70,22 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.bulkImageUploadUpdateForm input.text, .bulkImageUploadUpdateForm input.checkbox, .bulkImageUploadUpdateForm select, .bulkImageUploadUpdateForm textarea').entwine({
|
||||||
|
onchange: function(){
|
||||||
|
this.closest('.bulkImageUploadUpdateForm').haschanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//textarea node is being removed from the DOM when the HTMLEditorFieldChanges, not the best but works
|
||||||
|
$('.field.htmleditor textarea').entwine({
|
||||||
|
onmatch: function(){
|
||||||
|
},
|
||||||
|
onunmatch: function(){
|
||||||
|
//note sure why querying straight from the texarea doesn't work... maybe because it is already removed from DOM?
|
||||||
|
$('input[type="hidden"][name="'+$(this).attr('name')+'"]').parents('.bulkImageUploadUpdateForm').haschanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#bulkImageUploadUpdateBtn:not(.ui-state-disabled)').entwine({
|
$('#bulkImageUploadUpdateBtn:not(.ui-state-disabled)').entwine({
|
||||||
onmatch: function(){
|
onmatch: function(){
|
||||||
$(this).data('completedForms', 0);
|
$(this).data('completedForms', 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user