Skip to content
Snippets Groups Projects
Commit 114c7a57 authored by Tirupati Singh's avatar Tirupati Singh Committed by Stephen Mustgrave
Browse files

Issue #3425669: Removed jquery once library.

parent e42a35f1
No related branches found
No related tags found
No related merge requests found
(function ($, Drupal) {
(function ($, Drupal, once) {
Drupal.behaviors.quizAnswerConfirm = {
attach: function (context, settings) {
$('#quiz-question-answering-form #edit-navigation-submit, #quiz-question-answering-form #edit-navigation-skip').once('quizConfirm').click(function (event) {
$(once('quizConfirm', '#quiz-question-answering-form #edit-navigation-submit, #quiz-question-answering-form #edit-navigation-skip', context)).click(function (event) {
// Return false to avoid submitting if user aborts
if (!confirm($('#quiz-question-answering-form').data('confirm-message'))) {
event.preventDefault();
......@@ -9,5 +9,5 @@
});
}
};
})(jQuery, Drupal);
})(jQuery, Drupal, once);
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, once) {
Drupal.behaviors.quiz_multichoice_refreshScores = {
attach: function (context, settings) {
$('.quiz-multichoice-correct-checkbox').once().change(function (e) {
$(once('mcq-correct-checkbox', '.quiz-multichoice-correct-checkbox', context)).change(function (e) {
correct = $(this).is(':checked');
delta = $(this).attr('data-multichoice-delta');
......@@ -76,9 +76,8 @@
* @todo not working in D8.
*/
Drupal.behaviors.quiz_multichoice_multichoiceAlternativeBehavior = {
attach: (context, settings) => {
$('.multichoice-row')
.once()
attach: function (context, settings) {
$(once('multi-choice', '.multichoice-row', context))
.filter(':has(:checkbox:checked)')
.addClass('selected')
.end()
......@@ -108,4 +107,5 @@
});
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, once);
......@@ -2,4 +2,6 @@ helper:
js:
js/helper.js: {}
dependencies:
- core/drupal
- core/jquery
- core/once
......@@ -5,6 +5,10 @@ styles:
confirm:
js:
js/confirm.js: {}
dependencies:
- core/drupal
- core/jquery
- core/once
jumper:
js:
js/jumper.js: {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment