Initial Drupal 11 with DDEV setup
This commit is contained in:
36
web/core/misc/tabledrag-ajax.js
Normal file
36
web/core/misc/tabledrag-ajax.js
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Ajax command for highlighting elements.
|
||||
*
|
||||
* @param {Drupal.Ajax} [ajax]
|
||||
* An Ajax object.
|
||||
* @param {object} response
|
||||
* The Ajax response.
|
||||
* @param {string} response.id
|
||||
* The row id.
|
||||
* @param {string} response.tabledrag_instance
|
||||
* The tabledrag instance identifier.
|
||||
* @param {number} [status]
|
||||
* The HTTP status code.
|
||||
*/
|
||||
Drupal.AjaxCommands.prototype.tabledragChanged = function (
|
||||
ajax,
|
||||
response,
|
||||
status,
|
||||
) {
|
||||
if (status !== 'success') {
|
||||
return;
|
||||
}
|
||||
|
||||
const tableDrag = Drupal.tableDrag[response.tabledrag_instance];
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
const rowObject = new tableDrag.row(
|
||||
document.getElementById(response.id),
|
||||
'',
|
||||
tableDrag.indentEnabled,
|
||||
tableDrag.maxDepth,
|
||||
true,
|
||||
);
|
||||
rowObject.markChanged();
|
||||
rowObject.addChangedWarning();
|
||||
};
|
||||
Reference in New Issue
Block a user