File tree Expand file tree Collapse file tree 3 files changed +293
-260
lines changed
Catalog/view/adminhtml/web/catalog/category
Sales/view/adminhtml/web/order/create Expand file tree Collapse file tree 3 files changed +293
-260
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,28 @@ define([
51
51
*/
52
52
function categoryProductRowClick ( grid , event ) {
53
53
var trElement = Event . findElement ( event , 'tr' ) ,
54
- isInput = Event . element ( event ) . tagName === 'INPUT' ,
54
+ eventElement = Event . element ( event ) ,
55
+ isInputCheckbox = eventElement . tagName === 'INPUT' && eventElement . type === 'checkbox' ,
56
+ isInputPosition = grid . targetElement
57
+ && grid . targetElement . tagName === 'INPUT'
58
+ && grid . targetElement . name === 'position' ,
55
59
checked = false ,
56
60
checkbox = null ;
57
61
58
- if ( trElement ) {
62
+ if ( eventElement . tagName === 'LABEL'
63
+ && trElement . querySelector ( '#' + eventElement . htmlFor )
64
+ && trElement . querySelector ( '#' + eventElement . htmlFor ) . type === 'checkbox'
65
+ ) {
66
+ event . stopPropagation ( ) ;
67
+ trElement . querySelector ( '#' + eventElement . htmlFor ) . trigger ( 'click' ) ;
68
+ return ;
69
+ }
70
+
71
+ if ( trElement && ! isInputPosition ) {
59
72
checkbox = Element . getElementsBySelector ( trElement , 'input' ) ;
60
73
61
74
if ( checkbox [ 0 ] ) {
62
- checked = isInput ? checkbox [ 0 ] . checked : ! checkbox [ 0 ] . checked ;
75
+ checked = isInputCheckbox ? checkbox [ 0 ] . checked : ! checkbox [ 0 ] . checked ;
63
76
gridJsObject . setCheckboxChecked ( checkbox [ 0 ] , checked ) ;
64
77
}
65
78
}
You can’t perform that action at this time.
0 commit comments