diff options
| author | Anshuman Sharma <ans@odoo.com> | 2018-12-19 06:49:11 +0000 |
|---|---|---|
| committer | Dharmraj Jhala <dja@odoo.com> | 2019-06-17 04:11:28 +0000 |
| commit | 696e31d3077c0bc418cac3537ba98cadb3029ef2 (patch) | |
| tree | 2a462aa7ae99a6ee752e128313b12707581cc7fe /addons/web/static/src | |
| parent | 669b224f664023876e141b011e2cad46fe240cee (diff) | |
[FIX] web: highlight clickable pivot cells on hover
After a recent reorganization of the web client's components tree, the
class 'o_enable_linking' was added on the wrong element. This made the
css rule responsible of the highlighting of the clickable pivot cells
impossible to satisfy.
This commit fixes the issue by adding the class directly in the template
'PivotView'.
Additionally, this commit also makes visually clear when a field
selection menu-items is disabled (because it is already used) using
a 'not-allowed' cursor (which was removed in bs4). It is now again
possible to open a list view by clicking on a cell with zero value
(like in Odoo 11).
task-1916889
closes odoo/odoo#34165
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_controller.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_renderer.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/scss/pivot_view.scss | 5 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_controller.js b/addons/web/static/src/js/views/pivot/pivot_controller.js index ac48ab769ff..fbc08e93b1e 100644 --- a/addons/web/static/src/js/views/pivot/pivot_controller.js +++ b/addons/web/static/src/js/views/pivot/pivot_controller.js @@ -53,7 +53,6 @@ var PivotController = AbstractController.extend({ * @override */ start: function () { - this.$el.toggleClass('o_enable_linking', this.enableLinking); this.$fieldSelection = this.$('.o_field_selection'); core.bus.on('click', this, function () { this.$fieldSelection.empty(); diff --git a/addons/web/static/src/js/views/pivot/pivot_renderer.js b/addons/web/static/src/js/views/pivot/pivot_renderer.js index 1a3c451f064..33f7f2e2fbf 100644 --- a/addons/web/static/src/js/views/pivot/pivot_renderer.js +++ b/addons/web/static/src/js/views/pivot/pivot_renderer.js @@ -283,7 +283,7 @@ var PivotRenderer = AbstractRenderer.extend({ $cell = $('<td>') .data('id', rows[i].id) .data('col_id', rows[i].col_ids[Math.floor(j / nbrMeasures)]) - .toggleClass('o_empty', !value) + .toggleClass('o_empty', _.isUndefined(value)) .addClass('o_pivot_cell_value text-right'); if (value !== undefined) { $cell.append($('<div>', {class: 'o_value'}).html(formatter(value, measure))); diff --git a/addons/web/static/src/scss/pivot_view.scss b/addons/web/static/src/scss/pivot_view.scss index 83f8fbc58e7..6bc25ee114e 100644 --- a/addons/web/static/src/scss/pivot_view.scss +++ b/addons/web/static/src/scss/pivot_view.scss @@ -87,4 +87,9 @@ right: 6px; top: 9px; } + + .o_pivot_field_menu .dropdown-item.disabled { + color: $text-muted; + cursor: default; + } } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 19d9078ce17..46e05a5d352 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -529,7 +529,7 @@ </div> </div> -<div t-name="PivotView" class="o_pivot"> +<div t-name="PivotView" t-attf-class="o_pivot #{widget.enableLinking ? 'o_enable_linking' : ''}"> <div class="o_field_selection"/> </div> <t t-name="PivotView.buttons"> |
