diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-10-27 12:59:27 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-10-30 16:00:43 +0000 |
| commit | 6d2c030b9eb37f3f524125aeeeac4f6d70417ed0 (patch) | |
| tree | c7729a62a7b2937d3bc5467bd956ea22f5875a44 /addons/web/static/lib | |
| parent | dacc1703c486c8affb44df679ab5e8e2ba724867 (diff) | |
[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#61073
X-original-commit: 1f318d7c7aa66287c8756a89b49293b4e8c2217e
Related: odoo/enterprise#14505
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/lib')
| -rw-r--r-- | addons/web/static/lib/jquery.ui/jquery-ui.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/addons/web/static/lib/jquery.ui/jquery-ui.js b/addons/web/static/lib/jquery.ui/jquery-ui.js index 2d48addb2a3..d4b4ebabe17 100644 --- a/addons/web/static/lib/jquery.ui/jquery-ui.js +++ b/addons/web/static/lib/jquery.ui/jquery-ui.js @@ -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; + } } } } |
