[FIX] web, *: fix the grab cursor not working on all browsers

*: web_editor, point_of_sale, pos_restaurant

The grab cursor is currently not working on all browsers (at least
Chrome Linux). The fallback rule does not even work, meaning that if
you type:

```
cursor: move;
cursor: grab;
```

Those browsers does not even use "move" as they see "grab" as valid but
use the "default" cursor.

This commit replaces our "grab" uses with a local cursor ensuring it
works.

Related to task-2431469

closes odoo/odoo#82093

X-original-commit: 23ebcca902781f2fa0f2381997be4f3d375385b5
Related: odoo/enterprise#23193
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
qsm-odoo
2022-01-03 18:58:41 +00:00
committed by Romain Derie
parent faaf234e67
commit 3490b998ee
7 changed files with 19 additions and 15 deletions
+2 -6
View File
@@ -2851,16 +2851,12 @@ td {
}
.drag-handle {
cursor: move; /* fallback if grab cursor is unsupported */
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
/* See o-grab-cursor mixin */
cursor: url(/web/static/src/img/openhand.cur), grab;
}
.drag-handle:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
@@ -13,7 +13,7 @@
/* ------ FLOOR SELECTOR ------- */
.floor-selector {
.floor-selector {
line-height: 48px;
font-size: 18px;
display: -webkit-flex;
@@ -222,7 +222,8 @@
border-radius: 24px;
background: white;
box-shadow: 0px 2px 3px rgba(0,0,0,0.2);
cursor: grab;
/* See o-grab-cursor mixin */
cursor: url(/web/static/src/img/openhand.cur), grab;
transition: all 150ms linear;
z-index: 100;
transform: translate(-50%, -50%);
Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

@@ -37,7 +37,7 @@
flex: 1;
overflow: auto;
.o_short_field {
cursor: grab;
@include o-grab-cursor;
}
.o-field-placeholder {
border: 1px dashed $o-brand-primary;
@@ -367,7 +367,7 @@
// Handle widget
&.o_row_handle {
cursor: grab;
@include o-grab-cursor;
color: #adb5bd;
text-align: center;
width: 100%;
@@ -166,6 +166,16 @@
border-top: $caret-width solid transparent;
}
//-------------------------------------------------------------------
// Cursor
//-------------------------------------------------------------------
@mixin o-grab-cursor() {
// Use a custom cursor for the open hand icon as "grab" is not properly
// working on Chrome Linux (at least)
cursor: url(/web/static/src/img/openhand.cur), grab;
}
// ------------------------------------------------------------------
// Hovering effects
// ------------------------------------------------------------------
@@ -371,10 +371,7 @@ body.editor_enable.editor_has_snippets {
border-left: $o-we-sidebar-blocks-content-snippet-spacing solid transparent;
margin-bottom: $o-we-sidebar-blocks-content-snippet-spacing;
user-select: none;
cursor: pointer;
cursor: copy;
cursor: grab;
@include o-grab-cursor;
.oe_snippet_thumbnail_title {
display: block;
@@ -2143,7 +2140,7 @@ body.editor_enable.editor_has_snippets {
pointer-events: auto;
.o_we_overlay_content {
cursor: grab;
@include o-grab-cursor;
.o_we_grabbing {
cursor: grabbing;