[FIX] web: add rtl management for resizable jquery-ui widget

Issue

	- Install "Project" modules
	- Set user language as "Hebrew"
	- Go to Project and open any project
	- Go to 'gantt' view
	- Try to resize a task

	Everything is reversed.

Cause

	Jquery-ui 'resizable' widget do not manage RTL feature.

Solution

	Update the the `position.left` props according to the language
	direction (LTR or RTL).

opw-2367692

closes odoo/odoo#61082

X-original-commit: 1f318d7c7aa66287c8756a89b49293b4e8c2217e
Related: odoo/enterprise#14507
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2020-10-30 16:47:13 +00:00
parent 930a1fedc5
commit 0edf1ce246
+13 -2
View File
@@ -3527,6 +3527,8 @@ $.widget( "ui.resizable", $.ui.mouse, {
// See #7960
zIndex: 90,
odoo_isRTL: false,
// Callbacks
resize: null,
start: null,
@@ -3880,6 +3882,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
dx = ( event.pageX - smp.left ) || 0,
dy = ( event.pageY - smp.top ) || 0,
trigger = this._change[ a ];
dx = this.options.odoo_isRTL ? -dx : dx;
this._updatePrevProperties();
@@ -4651,11 +4654,19 @@ $.ui.plugin.add( "resizable", "grid", {
}
if ( newWidth - gridX > 0 ) {
that.size.width = newWidth;
that.position.left = op.left - ox;
if (that.options.odoo_isRTL) {
that.position.left = op.left + ox;
} else {
that.position.left = op.left - ox;
}
} else {
newWidth = gridX - outerDimensions.width;
that.size.width = newWidth;
that.position.left = op.left + os.width - newWidth;
if (that.options.odoo_isRTL) {
that.position.left = op.left - os.width + newWidth;
} else {
that.position.left = op.left + os.width - newWidth;
}
}
}
}