Skip to content
Snippets Groups Projects

Refactor uses of the jQuery class function

Closes #3239190

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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 single attr() use on line 151. As a framework manager, I say lets just address the attr() here so we don't have to bother making $target a jQuery object.

      const target = context.querySelector(options.target)

    • Please register or sign in to reply
  • 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
  • Ben Mullins
  • utkarsh_33 added 360 commits

    added 360 commits

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    • 9ae4a3fd - Removed unwanted changes due to rebase

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    • 7acb79c1 - Removed unwanted changes due to rebase

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • utkarsh_33 added 2 commits

    added 2 commits

    • 583c6411 - Addressed feedbacks
    • aa92a4f7 - Seperated into 2 different code pieces

    Compare with previous version

  • Please register or sign in to reply
    Loading