From c1272d65178b78c2d2c0db504b2e7649562b9f58 Mon Sep 17 00:00:00 2001 From: Tran Thanh Phuc Date: Sun, 31 Jan 2021 12:18:45 +0700 Subject: [PATCH] [IMP] web_tree_image_tooltip: black, isort, prettier --- web_tree_image_tooltip/__manifest__.py | 28 ++++++++----------- .../readme/CONTRIBUTORS.rst | 1 - web_tree_image_tooltip/readme/CREDITS.rst | 1 - web_tree_image_tooltip/readme/DESCRIPTION.rst | 1 - web_tree_image_tooltip/readme/USAGE.rst | 1 - .../static/src/js/tooltip.js | 28 ++++++++++--------- .../static/src/scss/common.scss | 10 +++---- web_tree_image_tooltip/view/assets.xml | 20 +++++++++---- 8 files changed, 46 insertions(+), 44 deletions(-) diff --git a/web_tree_image_tooltip/__manifest__.py b/web_tree_image_tooltip/__manifest__.py index b46057c1b..758879bf0 100644 --- a/web_tree_image_tooltip/__manifest__.py +++ b/web_tree_image_tooltip/__manifest__.py @@ -6,20 +6,16 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - 'name': 'Show images in tree views via tooltip', - 'version': '12.0.1.0.0', - 'author': "Therp BV, " - "MONK Software, " - "Odoo Community Association (OCA), " - "Serpent Consulting Services Pvt. Ltd.", - 'website': 'https://github.com/OCA/web', - 'license': 'AGPL-3', - 'category': 'Web', - 'depends': [ - 'web', - ], - 'data': [ - 'view/assets.xml', - ], - 'installable': True, + "name": "Show images in tree views via tooltip", + "version": "12.0.1.0.0", + "author": "Therp BV, " + "MONK Software, " + "Odoo Community Association (OCA), " + "Serpent Consulting Services Pvt. Ltd.", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "category": "Web", + "depends": ["web",], + "data": ["view/assets.xml",], + "installable": True, } diff --git a/web_tree_image_tooltip/readme/CONTRIBUTORS.rst b/web_tree_image_tooltip/readme/CONTRIBUTORS.rst index 24b755f9a..91b1bd5c0 100644 --- a/web_tree_image_tooltip/readme/CONTRIBUTORS.rst +++ b/web_tree_image_tooltip/readme/CONTRIBUTORS.rst @@ -3,4 +3,3 @@ * Jay Vora * Meet Dholakia * Nikul Chaudhary - diff --git a/web_tree_image_tooltip/readme/CREDITS.rst b/web_tree_image_tooltip/readme/CREDITS.rst index 7356ac20b..09b1864e3 100644 --- a/web_tree_image_tooltip/readme/CREDITS.rst +++ b/web_tree_image_tooltip/readme/CREDITS.rst @@ -1,2 +1 @@ * Serpent Consulting Services Pvt. Ltd. - diff --git a/web_tree_image_tooltip/readme/DESCRIPTION.rst b/web_tree_image_tooltip/readme/DESCRIPTION.rst index 092033b3b..95ac0f6b4 100644 --- a/web_tree_image_tooltip/readme/DESCRIPTION.rst +++ b/web_tree_image_tooltip/readme/DESCRIPTION.rst @@ -1,3 +1,2 @@ This module defines a images and icons in tree view via Tooltip. Additionally, Default width with 30px. - diff --git a/web_tree_image_tooltip/readme/USAGE.rst b/web_tree_image_tooltip/readme/USAGE.rst index a8eeccbfa..0357aceea 100644 --- a/web_tree_image_tooltip/readme/USAGE.rst +++ b/web_tree_image_tooltip/readme/USAGE.rst @@ -1,2 +1 @@ Mouse Hover in tree view image that time Tooltip effect. - diff --git a/web_tree_image_tooltip/static/src/js/tooltip.js b/web_tree_image_tooltip/static/src/js/tooltip.js index ce57c2799..f60597e10 100644 --- a/web_tree_image_tooltip/static/src/js/tooltip.js +++ b/web_tree_image_tooltip/static/src/js/tooltip.js @@ -1,19 +1,21 @@ -odoo.define('web_tree_image_tooltip.web_tree_image_tooltip', - function (require) { +odoo.define("web_tree_image_tooltip.web_tree_image_tooltip", function(require) { "use strict"; - var ListRenderer = require('web.ListRenderer'); + var ListRenderer = require("web.ListRenderer"); ListRenderer.include({ events: _.extend({}, ListRenderer.prototype.events, { - 'mouseover tbody tr td .o_field_image': '_onHoverRecord_img', + "mouseover tbody tr td .o_field_image": "_onHoverRecord_img", }), - _onHoverRecord_img: function (event) { - var img_src = - $(event.currentTarget).children('.img-fluid').attr('src') - $(event.currentTarget).tooltip({ - title: "", - delay: 0, - }).tooltip('show'); - } + _onHoverRecord_img: function(event) { + var img_src = $(event.currentTarget) + .children(".img-fluid") + .attr("src"); + $(event.currentTarget) + .tooltip({ + title: "", + delay: 0, + }) + .tooltip("show"); + }, }); -}) +}); diff --git a/web_tree_image_tooltip/static/src/scss/common.scss b/web_tree_image_tooltip/static/src/scss/common.scss index e7ccfbcde..600f7beb8 100644 --- a/web_tree_image_tooltip/static/src/scss/common.scss +++ b/web_tree_image_tooltip/static/src/scss/common.scss @@ -1,8 +1,8 @@ -.o_image_cell .o_field_image img{ - width:30px; +.o_image_cell .o_field_image img { + width: 30px; } .tooltip_image { - max-width:80vw; - max-height:80vh; -} \ No newline at end of file + max-width: 80vw; + max-height: 80vh; +} diff --git a/web_tree_image_tooltip/view/assets.xml b/web_tree_image_tooltip/view/assets.xml index d0d628f03..4426cee68 100644 --- a/web_tree_image_tooltip/view/assets.xml +++ b/web_tree_image_tooltip/view/assets.xml @@ -1,11 +1,19 @@ - + - -