Commit ffebc5c3 authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski
Browse files

Upgrade to jQuery 3.4.x; closes #6405

- use jquery-migrate to handle compatibility with old plugins
- fix breaking changes that are not handled by jquery-migrate
parent 7cc8303d
......@@ -38,6 +38,7 @@ The present file will list all changes made to the project; according to the
#### Changes
- jQuery library has been upgraded from 2.2.x to 3.4.x. jQuery Migrate is used to ensure backward compatibility in most cases.
- `DBmysqlIterator::handleOrderClause()` supports QueryExpressions
#### Deprecated
......@@ -73,6 +74,8 @@ The present file will list all changes made to the project; according to the
- `Toolbox::checkSELinux()`
- `Toolbox::userErrorHandlerDebug()`
- `Toolbox::userErrorHandlerNormal()`
- `Html::jsDisable()`
- `Html::jsEnable()`
#### Removed
......
......@@ -4475,6 +4475,7 @@ JAVASCRIPT;
* @param $id string id of the dom element
*
* @since 0.85.
* @deprecated 9.5.0
*
* @return String
**/
......@@ -4489,6 +4490,7 @@ JAVASCRIPT;
* @param $id string id of the dom element
*
* @since 0.85.
* @deprecated 9.5.0
*
* @return String
**/
......
......@@ -124,7 +124,7 @@ class NotificationSettingConfig extends CommonDBTM {
$('[name=use_notifications]').on('change', function() {
var _val = $(this).find('option:selected').val();
if (_val == '1') {
$('select[name!=use_notifications]').removeAttr('disabled');
$('select[name!=use_notifications]').prop('disabled', false);
} else {
$('select[name!=use_notifications]').select2('enable', false);
}
......
......@@ -232,10 +232,7 @@ $.fn.shiftSelectable = function() {
}
};
$($boxes.selector).parent().click(function(evt) {
if ($boxes.length <= 0) {
$boxes = $($boxes.selector);
}
$($boxes).parent().click(function(evt) {
var selected_checkbox = $(this).children('input[type=checkbox]');
if (!lastChecked) {
......
......@@ -579,21 +579,23 @@ var GLPIImpact = {
}
// Build the new subgraph
$.when(GLPIImpact.buildGraphFromNode(node)).then(
function (graph) {
// Insert the new graph data into the current graph
GLPIImpact.insertGraph(graph, {
id: nodeID,
x: position.x,
y: position.y
});
GLPIImpact.updateFlags();
},
function () {
// Ajax failed
alert(__("Unexpected error."));
}
);
$.when(GLPIImpact.buildGraphFromNode(node))
.done(
function (graph) {
// Insert the new graph data into the current graph
GLPIImpact.insertGraph(graph, {
id: nodeID,
x: position.x,
y: position.y
});
GLPIImpact.updateFlags();
}
).fail(
function () {
// Ajax failed
alert(__("Unexpected error."));
}
);
},
/**
......
......@@ -36,6 +36,10 @@ require('@fortawesome/fontawesome-free/css/all.css');
// '$' and 'jQuery' objects have to be declared in global scope
window.$ = window.jQuery = require('jquery');
require('jquery-migrate');
window.$.migrateMute = true;
window.$.migrateTrace = false;
// jQuery UI
// Requirement order has been inspired by jquery-ui-dist build.
require('jquery-ui/ui/version');
......
......@@ -3269,9 +3269,14 @@
"dev": true
},
"jquery": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz",
"integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI="
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
},
"jquery-migrate": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.1.0.tgz",
"integrity": "sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ=="
},
"jquery-mousewheel": {
"version": "3.1.13",
......@@ -3303,6 +3308,13 @@
"requires": {
"jquery": "1.9.1 - 3.2.x",
"jquery-ui": "1.7.0 - 1.12.x"
},
"dependencies": {
"jquery": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz",
"integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c="
}
}
},
"jquery-ui-timepicker-addon": {
......
......@@ -84,6 +84,7 @@ var libsConfig = {
path.resolve(__dirname, 'node_modules/cystoscape'),
path.resolve(__dirname, 'node_modules/cytoscape-context-menus'),
path.resolve(__dirname, 'node_modules/gridstack'),
path.resolve(__dirname, 'node_modules/jquery-migrate'),
path.resolve(__dirname, 'node_modules/jquery-ui-multidatespicker'),
path.resolve(__dirname, 'node_modules/jstree'),
path.resolve(__dirname, 'node_modules/photoswipe'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment