mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-06-26 14:39:37 +02:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
|
(function($) {
|
||
|
|
||
|
$.entwine('colymba', function($) {
|
||
|
|
||
|
$('td.col-bulkSelect').entwine({
|
||
|
onmatch: function(){
|
||
|
},
|
||
|
onunmatch: function(){
|
||
|
},
|
||
|
onmouseover: function(){
|
||
|
//disable default row click behaviour -> avoid navigation to edit form when clicking the checkbox
|
||
|
$(this).parents('.ss-gridfield-item').find('.edit-link').addClass('tempDisabledEditLink').removeClass('edit-link').css('display','none');
|
||
|
},
|
||
|
onmouseout: function(){
|
||
|
//re-enable default row click behaviour
|
||
|
$(this).parents('.ss-gridfield-item').find('.tempDisabledEditLink').addClass('edit-link').removeClass('tempDisabledEditLink').css('display','inline-block');
|
||
|
},
|
||
|
onclick: function(e) {
|
||
|
//check/uncheck checkbox when clicking cell
|
||
|
var cb = $(e.target).find('input');
|
||
|
if ( !$(cb).prop('checked') ) $(cb).prop('checked', true);
|
||
|
else $(cb).prop('checked', false);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('td.col-bulkSelect input').entwine({
|
||
|
onmatch: function(){
|
||
|
},
|
||
|
onunmatch: function(){
|
||
|
},
|
||
|
onclick: function(e) {
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
}(jQuery));
|