summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/node/node.js
diff options
context:
space:
mode:
authorLauri Eskola <lauri.eskola@acquia.com>2022-01-17 18:08:33 +0200
committerLauri Eskola <lauri.eskola@acquia.com>2022-01-17 18:08:33 +0200
commit68081082c0605192b76850d96ae8a058c256ecca (patch)
tree51c2b7ea3ef5c6e229a308e4a4922688372d83a8 /core/modules/node/node.js
parent440bcc0551fd41ed2197808b38a1c42524993899 (diff)
downloaddrupal-68081082c0605192b76850d96ae8a058c256ecca.tar.gz
drupal-68081082c0605192b76850d96ae8a058c256ecca.zip
Issue #3239134 by hooroomoo, bnjmnm, yogeshmpawar, nod_, Theresa.Grannum, larowlan: Refactor (if feasible) uses of the jQuery val function to use VanillaJS
Diffstat (limited to 'core/modules/node/node.js')
-rw-r--r--core/modules/node/node.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index d50a617f8716..a31756ca98e0 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -10,9 +10,10 @@
attach(context) {
const $context = $(context);
$context.find('.node-form-author').drupalSetSummary(context => {
- const $authorContext = $(context);
- const name = $authorContext.find('.field--name-uid input').val();
- const date = $authorContext.find('.field--name-created input').val();
+ const nameElement = context.querySelector('.field--name-uid input');
+ const name = nameElement && nameElement.value;
+ const dateElement = context.querySelector('.field--name-created input');
+ const date = dateElement && dateElement.value;
if (name && date) {
return Drupal.t('By @name on @date', {