Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gin
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
gin
Commits
9a01ff17
Commit
9a01ff17
authored
3 months ago
by
Volker Killesreiter
Committed by
Sascha Eggenberger
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3499408
: custom ajax button not working anymore
parent
ab71bce1
No related branches found
No related tags found
1 merge request
!576
Issue #3499408: custom ajax button not working anymore
Pipeline
#423903
passed
3 months ago
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dist/js/more_actions.js
+2
-1
2 additions, 1 deletion
dist/js/more_actions.js
js/more_actions.js
+2
-0
2 additions, 0 deletions
js/more_actions.js
with
4 additions
and
1 deletion
dist/js/more_actions.js
+
2
−
1
View file @
9a01ff17
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
buttonSelector
&&
(
buttonSelector
.
setAttribute
(
"
form
"
,
formId
),
buttonSelector
.
setAttribute
(
"
data-gin-sticky-form-selector
"
,
buttonId
),
buttonSelector
&&
(
buttonSelector
.
setAttribute
(
"
form
"
,
formId
),
buttonSelector
.
setAttribute
(
"
data-gin-sticky-form-selector
"
,
buttonId
),
buttonSelector
.
addEventListener
(
"
click
"
,
(
e
=>
{
buttonSelector
.
addEventListener
(
"
click
"
,
(
e
=>
{
const
button
=
document
.
querySelector
(
`#
${
formId
}
[data-drupal-selector="
${
buttonId
}
"]`
);
const
button
=
document
.
querySelector
(
`#
${
formId
}
[data-drupal-selector="
${
buttonId
}
"]`
);
null
!==
button
&&
(
e
.
preventDefault
(),
button
.
click
());
null
!==
button
&&
(
e
.
preventDefault
(),
once
.
filter
(
"
drupal-ajax
"
,
button
).
length
&&
button
.
dispatchEvent
(
new
Event
(
"
mousedown
"
)),
button
.
click
());
})));
})));
}));
}));
}
}
...
...
This diff is collapsed.
Click to expand it.
js/more_actions.js
+
2
−
0
View file @
9a01ff17
...
@@ -60,6 +60,8 @@
...
@@ -60,6 +60,8 @@
return
;
return
;
}
}
e
.
preventDefault
();
e
.
preventDefault
();
// Additionally trigger mouse down event in case of AJAX.
once
.
filter
(
'
drupal-ajax
'
,
button
).
length
&&
button
.
dispatchEvent
(
new
Event
(
'
mousedown
'
));
button
.
click
();
button
.
click
();
});
});
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment