mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-71344-master' of git://github.com/HuongNV13/moodle
This commit is contained in:
commit
c844ae5313
9 changed files with 55 additions and 13 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -947,6 +947,12 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys
|
||||||
*/
|
*/
|
||||||
eventHandlersInitialised: false,
|
eventHandlersInitialised: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {Object} ensures that the drag event handlers are only initialised once per question,
|
||||||
|
* indexed by containerId (id on the .que div).
|
||||||
|
*/
|
||||||
|
dragEventHandlersInitialised: {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {boolean} is printing or not.
|
* {boolean} is printing or not.
|
||||||
*/
|
*/
|
||||||
|
@ -977,14 +983,22 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys
|
||||||
questionManager.setupEventHandlers();
|
questionManager.setupEventHandlers();
|
||||||
questionManager.eventHandlersInitialised = true;
|
questionManager.eventHandlersInitialised = true;
|
||||||
}
|
}
|
||||||
|
if (!questionManager.dragEventHandlersInitialised.hasOwnProperty(containerId)) {
|
||||||
|
questionManager.dragEventHandlersInitialised[containerId] = true;
|
||||||
|
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
||||||
|
var questionContainer = document.getElementById(containerId);
|
||||||
|
if (questionContainer.classList.contains('ddimageortext') &&
|
||||||
|
!questionContainer.classList.contains('qtype_ddimageortext-readonly')) {
|
||||||
|
// TODO: Convert all the jQuery selectors and events to native Javascript.
|
||||||
|
questionManager.addEventHandlersToDrag($(questionContainer).find('.draghome'));
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the event handlers that make this question type work. (Done once per page.)
|
* Set up the event handlers that make this question type work. (Done once per page.)
|
||||||
*/
|
*/
|
||||||
setupEventHandlers: function() {
|
setupEventHandlers: function() {
|
||||||
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
|
||||||
questionManager.addEventHandlersToDrag($('.que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome'));
|
|
||||||
$('body')
|
$('body')
|
||||||
.on('keydown',
|
.on('keydown',
|
||||||
'.que.ddimageortext:not(.qtype_ddimageortext-readonly) .dropzones .dropzone',
|
'.que.ddimageortext:not(.qtype_ddimageortext-readonly) .dropzones .dropzone',
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -682,6 +682,12 @@ define(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes', 'core/key_codes'], f
|
||||||
*/
|
*/
|
||||||
eventHandlersInitialised: false,
|
eventHandlersInitialised: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {Object} ensures that the marker event handlers are only initialised once per question,
|
||||||
|
* indexed by containerId (id on the .que div).
|
||||||
|
*/
|
||||||
|
markerEventHandlersInitialised: {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {boolean} is printing or not.
|
* {boolean} is printing or not.
|
||||||
*/
|
*/
|
||||||
|
@ -711,15 +717,23 @@ define(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes', 'core/key_codes'], f
|
||||||
questionManager.setupEventHandlers();
|
questionManager.setupEventHandlers();
|
||||||
questionManager.eventHandlersInitialised = true;
|
questionManager.eventHandlersInitialised = true;
|
||||||
}
|
}
|
||||||
|
if (!questionManager.markerEventHandlersInitialised.hasOwnProperty(containerId)) {
|
||||||
|
questionManager.markerEventHandlersInitialised[containerId] = true;
|
||||||
|
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
||||||
|
var questionContainer = document.getElementById(containerId);
|
||||||
|
if (questionContainer.classList.contains('ddmarker') &&
|
||||||
|
!questionContainer.classList.contains('qtype_ddmarker-readonly')) {
|
||||||
|
// TODO: Convert all the jQuery selectors and events to native Javascript.
|
||||||
|
questionManager.addEventHandlersToMarker($(questionContainer).find('div.draghomes .marker'));
|
||||||
|
questionManager.addEventHandlersToMarker($(questionContainer).find('div.droparea .marker'));
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the event handlers that make this question type work. (Done once per page.)
|
* Set up the event handlers that make this question type work. (Done once per page.)
|
||||||
*/
|
*/
|
||||||
setupEventHandlers: function() {
|
setupEventHandlers: function() {
|
||||||
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
|
||||||
questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.draghomes .marker'));
|
|
||||||
questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.droparea .marker'));
|
|
||||||
$(window).on('resize', function() {
|
$(window).on('resize', function() {
|
||||||
questionManager.handleWindowResize(false);
|
questionManager.handleWindowResize(false);
|
||||||
});
|
});
|
||||||
|
|
2
question/type/ddwtos/amd/build/ddwtos.min.js
vendored
2
question/type/ddwtos/amd/build/ddwtos.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -734,6 +734,12 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys
|
||||||
*/
|
*/
|
||||||
eventHandlersInitialised: false,
|
eventHandlersInitialised: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {Object} ensures that the drag event handlers are only initialised once per question,
|
||||||
|
* indexed by containerId (id on the .que div).
|
||||||
|
*/
|
||||||
|
dragEventHandlersInitialised: {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {boolean} is keyboard navigation or not.
|
* {boolean} is keyboard navigation or not.
|
||||||
*/
|
*/
|
||||||
|
@ -756,14 +762,22 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys
|
||||||
questionManager.setupEventHandlers();
|
questionManager.setupEventHandlers();
|
||||||
questionManager.eventHandlersInitialised = true;
|
questionManager.eventHandlersInitialised = true;
|
||||||
}
|
}
|
||||||
|
if (!questionManager.dragEventHandlersInitialised.hasOwnProperty(containerId)) {
|
||||||
|
questionManager.dragEventHandlersInitialised[containerId] = true;
|
||||||
|
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
||||||
|
var questionContainer = document.getElementById(containerId);
|
||||||
|
if (questionContainer.classList.contains('ddwtos') &&
|
||||||
|
!questionContainer.classList.contains('qtype_ddwtos-readonly')) {
|
||||||
|
// TODO: Convert all the jQuery selectors and events to native Javascript.
|
||||||
|
questionManager.addEventHandlersToDrag($(questionContainer).find('span.draghome'));
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the event handlers that make this question type work. (Done once per page.)
|
* Set up the event handlers that make this question type work. (Done once per page.)
|
||||||
*/
|
*/
|
||||||
setupEventHandlers: function() {
|
setupEventHandlers: function() {
|
||||||
// We do not use the body event here to prevent the other event on Mobile device, such as scroll event.
|
|
||||||
questionManager.addEventHandlersToDrag($('.que.ddwtos:not(.qtype_ddwtos-readonly) span.draghome'));
|
|
||||||
$('body')
|
$('body')
|
||||||
.on('keydown',
|
.on('keydown',
|
||||||
'.que.ddwtos:not(.qtype_ddwtos-readonly) span.drop',
|
'.que.ddwtos:not(.qtype_ddwtos-readonly) span.drop',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue