mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-45226 AJAX: Backport upstream bug fixes from YUI
This backports the following two patches: * https://github.com/yui/yui3/issues/1757 * https://github.com/yui/yui3/issues/1778
This commit is contained in:
parent
d55806ce05
commit
7c5ea4935a
7 changed files with 14 additions and 8 deletions
|
@ -359,8 +359,10 @@ $CFG->yui3version = '3.15.0';
|
||||||
// If we need to patch a YUI modules between official YUI releases, the yuipatchlevel will need to be manually
|
// If we need to patch a YUI modules between official YUI releases, the yuipatchlevel will need to be manually
|
||||||
// incremented here. The module will also need to be listed in the yuipatchedmodules.
|
// incremented here. The module will also need to be listed in the yuipatchedmodules.
|
||||||
// When upgrading to a subsequent version of YUI, these should be reset back to 0 and an empty array.
|
// When upgrading to a subsequent version of YUI, these should be reset back to 0 and an empty array.
|
||||||
$CFG->yuipatchlevel = 0;
|
$CFG->yuipatchlevel = 1;
|
||||||
$CFG->yuipatchedmodules = array(
|
$CFG->yuipatchedmodules = array(
|
||||||
|
'dd-drag',
|
||||||
|
'dd-gestures',
|
||||||
);
|
);
|
||||||
|
|
||||||
// Store settings from config.php in array in $CFG - we can use it later to detect problems and overrides.
|
// Store settings from config.php in array in $CFG - we can use it later to detect problems and overrides.
|
||||||
|
|
|
@ -765,6 +765,9 @@ YUI.add('dd-drag', function (Y, NAME) {
|
||||||
* @param {EventFacade} ev The Event
|
* @param {EventFacade} ev The Event
|
||||||
*/
|
*/
|
||||||
_handleMouseDownEvent: function(ev) {
|
_handleMouseDownEvent: function(ev) {
|
||||||
|
if (this.validClick(ev)) {
|
||||||
|
ev.preventDefault();
|
||||||
|
}
|
||||||
this.fire(EV_MOUSE_DOWN, { ev: ev });
|
this.fire(EV_MOUSE_DOWN, { ev: ev });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
4
lib/yuilib/3.15.0/dd-drag/dd-drag-min.js
vendored
4
lib/yuilib/3.15.0/dd-drag/dd-drag-min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -764,6 +764,9 @@ YUI.add('dd-drag', function (Y, NAME) {
|
||||||
* @param {EventFacade} ev The Event
|
* @param {EventFacade} ev The Event
|
||||||
*/
|
*/
|
||||||
_handleMouseDownEvent: function(ev) {
|
_handleMouseDownEvent: function(ev) {
|
||||||
|
if (this.validClick(ev)) {
|
||||||
|
ev.preventDefault();
|
||||||
|
}
|
||||||
this.fire(EV_MOUSE_DOWN, { ev: ev });
|
this.fire(EV_MOUSE_DOWN, { ev: ev });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -54,8 +54,7 @@ YUI.add('dd-gestures', function (Y, NAME) {
|
||||||
this._createPG();
|
this._createPG();
|
||||||
this._active = true;
|
this._active = true;
|
||||||
Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), {
|
Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), {
|
||||||
standAlone: true,
|
standAlone: true
|
||||||
preventDefault: true
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,4 +5,4 @@ Licensed under the BSD License.
|
||||||
http://yuilibrary.com/license/
|
http://yuilibrary.com/license/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
YUI.add("dd-gestures",function(e,t){e.DD.Drag.START_EVENT="gesturemovestart",e.DD.Drag.prototype._prep=function(){this._dragThreshMet=!1;var t=this.get("node"),n=e.DD.DDM;t.addClass(n.CSS_PREFIX+"-draggable"),t.on(e.DD.Drag.START_EVENT,e.bind(this._handleMouseDownEvent,this),{minDistance:this.get("clickPixelThresh"),minTime:this.get("clickTimeThresh")}),t.on("gesturemoveend",e.bind(this._handleMouseUp,this),{standAlone:!0}),t.on("dragstart",e.bind(this._fixDragStart,this))};var n=e.DD.Drag.prototype._unprep;e.DD.Drag.prototype._unprep=function(){var e=this.get("node");n.call(this),e.detachAll("gesturemoveend")},e.DD.DDM._setupListeners=function(){var t=e.DD.DDM;this._createPG(),this._active=!0,e.one(e.config.doc).on("gesturemove",e.throttle(e.bind(t._move,t),t.get("throttleTime")),{standAlone:!0,preventDefault:!0})}},"3.15.0",{requires:["dd-drag","event-synthetic","event-gestures"]});
|
YUI.add("dd-gestures",function(e,t){e.DD.Drag.START_EVENT="gesturemovestart",e.DD.Drag.prototype._prep=function(){this._dragThreshMet=!1;var t=this.get("node"),n=e.DD.DDM;t.addClass(n.CSS_PREFIX+"-draggable"),t.on(e.DD.Drag.START_EVENT,e.bind(this._handleMouseDownEvent,this),{minDistance:this.get("clickPixelThresh"),minTime:this.get("clickTimeThresh")}),t.on("gesturemoveend",e.bind(this._handleMouseUp,this),{standAlone:!0}),t.on("dragstart",e.bind(this._fixDragStart,this))};var n=e.DD.Drag.prototype._unprep;e.DD.Drag.prototype._unprep=function(){var e=this.get("node");n.call(this),e.detachAll("gesturemoveend")},e.DD.DDM._setupListeners=function(){var t=e.DD.DDM;this._createPG(),this._active=!0,e.one(e.config.doc).on("gesturemove",e.throttle(e.bind(t._move,t),t.get("throttleTime")),{standAlone:!0})}},"3.15.0",{requires:["dd-drag","event-synthetic","event-gestures"]});
|
||||||
|
|
|
@ -52,8 +52,7 @@ YUI.add('dd-gestures', function (Y, NAME) {
|
||||||
this._createPG();
|
this._createPG();
|
||||||
this._active = true;
|
this._active = true;
|
||||||
Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), {
|
Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), {
|
||||||
standAlone: true,
|
standAlone: true
|
||||||
preventDefault: true
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue