Refactor uses of the jQuery class function
3 open threads
Closes #3239190
Merge request reports
Activity
added 111 commits
-
bc0f1e8f...4b5138e6 - 98 commits from branch
project:11.x
- 4b5138e6...c06f1a97 - 3 earlier commits
- 1bfe0473 - fix pipeline 2
- b4cd19a5 - refactor more addClass
- cd907110 - fix error
- 26ad3278 - fix pipeline
- 75adb6da - refactored more addClass
- 5c41505b - fix errors
- ab98cf2b - fix block layout erros
- 50b9ce6f - refactored more addClass
- 12d6f79e - fix pipeline
- 161bafea - refactored remaining addCkass
Toggle commit list-
bc0f1e8f...4b5138e6 - 98 commits from branch
added 13 commits
- 161bafea...8bb5856b - 3 earlier commits
- bffc0e80 - fix pipeline 2
- 05b408d4 - refactor more addClass
- fcd2bca4 - fix error
- 3a24f4cc - fix pipeline
- bec1ebf3 - refactored more addClass
- e3d681c1 - fix errors
- aa3bf014 - fix block layout erros
- ec6c6064 - refactored more addClass
- 6c9eed9e - fix pipeline
- c7526dea - refactored remaining addCkass
Toggle commit listadded 1 commit
- 0dae375a - refactored removeClass with classList.remove
added 52 commits
-
2db505d7...18125a46 - 31 commits from branch
project:11.x
- 18125a46...59e2182b - 11 earlier commits
- 037f044d - fix pipeline
- e9324d8c - refactored remaining addCkass
- 4655dec9 - Refactored removeClass
- 26d74c81 - fixed tests
- 549b9699 - refactored more removeClass
- a745ad53 - refactored removeClass and fixed tests
- f9c20df5 - fix tests for removeClass
- 20b549e1 - refactored removeClass with classList.remove
- c14ea4b4 - refactored hasClass method
- 1e3967e2 - Fixed tests.
Toggle commit list-
2db505d7...18125a46 - 31 commits from branch
added 404 commits
-
f554fafc...5c82c988 - 376 commits from branch
project:11.x
- 5c82c988...33f93c3f - 18 earlier commits
- e137776a - refactored removeClass with classList.remove
- 3e3cc352 - refactored hasClass method
- 7575ccde - Fixed tests.
- 437cf879 - refactored toggleClass
- e298efec - fixed tests
- 2098153f - refactored more toggleClass
- 26375afd - refactored more toggleClass
- 72d15c7b - Refactored remaining class methods
- 1b1840fc - Fixed linting.
- e9d5b759 - Fixed tests.
Toggle commit list-
f554fafc...5c82c988 - 376 commits from branch
added 287 commits
-
e9d5b759...580bfcb7 - 259 commits from branch
project:11.x
- 580bfcb7...3f1b3c9f - 18 earlier commits
- 7dafa3f2 - refactored removeClass with classList.remove
- 364ddfb0 - refactored hasClass method
- f54b1760 - Fixed tests.
- ace27f14 - refactored toggleClass
- 8a0f860e - fixed tests
- 0045033a - refactored more toggleClass
- e48ee457 - refactored more toggleClass
- 73457a89 - Refactored remaining class methods
- d7b274b6 - Fixed linting.
- 68da9f76 - Fixed tests.
Toggle commit list-
e9d5b759...580bfcb7 - 259 commits from branch
added 167 commits
-
8e7f0a02...e63b0c22 - 138 commits from branch
project:11.x
- e63b0c22...4ef62322 - 19 earlier commits
- f3b61658 - refactored hasClass method
- ed8c326d - Fixed tests.
- a7c55546 - refactored toggleClass
- 9af59855 - fixed tests
- 0ccd5f0d - refactored more toggleClass
- 0dae68f1 - refactored more toggleClass
- 3b896897 - Refactored remaining class methods
- 924c2c9f - Fixed linting.
- 187fd230 - Fixed tests.
- 65ec7006 - refactored new no-class metthods
Toggle commit list-
8e7f0a02...e63b0c22 - 138 commits from branch
- Resolved by quietone
120 120 Object.keys(settings.machineName).forEach((sourceId) => { 121 121 const options = settings.machineName[sourceId]; 122 122 123 const $source = $( 124 once( 125 'machine-name', 126 $context.find(sourceId).addClass('machine-name-source'), 127 ), 128 ); 129 const $target = $context 130 .find(options.target) 131 .addClass('machine-name-target'); 123 const $source = $(once('machine-name', $context.find(sourceId))); 124 $source[0]?.classList.add('machine-name-source'); 125 const $target = $context.find(options.target); 126 $target[0]?.classList.add('machine-name-target'); It looks like with the changes here
$target
is now only used with[0]
outside of a singleattr()
use on line 151. As a framework manager, I say lets just address theattr()
here so we don't have to bother making$target
a jQuery object.const target = context.querySelector(options.target)
120 120 Object.keys(settings.machineName).forEach((sourceId) => { 121 121 const options = settings.machineName[sourceId]; 122 122 123 const $source = $( 124 once( 125 'machine-name', 126 $context.find(sourceId).addClass('machine-name-source'), 127 ), 128 ); 129 const $target = $context 130 .find(options.target) 131 .addClass('machine-name-target'); 123 const $source = $(once('machine-name', $context.find(sourceId))); 694 694 const tagsSupportDisable = 695 695 'button, fieldset, optgroup, option, select, textarea, input'; 696 696 if (e.trigger) { 697 // eslint-disable-next-line jquery/no-class Is it good to seperate the 2 conditions as the prop is removed in https://www.drupal.org/project/drupal/issues/3238882 issue.Once this is confirmed then we can remove the comment.
Edited by utkarsh_33https://www.drupal.org/project/drupal/issues/3238882 is closed as won't fix
- Resolved by quietone
added 360 commits
-
65ec7006...35ca6308 - 330 commits from branch
project:11.x
- 35ca6308...ec16758b - 20 earlier commits
- 68fa83d6 - Fixed tests.
- c896b1ce - Rebasing
- bea66ee9 - fixed tests
- 25b4e09e - refactored more toggleClass
- d03f28ce - refactored more toggleClass
- 589520e5 - Refactored remaining class methods
- 1ab15951 - Fixed linting.
- bd04f742 - Fixed tests.
- c9e03e97 - refactored new no-class metthods
- e99cdd4f - Replaced [0] by document.body
Toggle commit list-
65ec7006...35ca6308 - 330 commits from branch
added 2 commits
Please register or sign in to reply