forked from Techsystech/web
[IMP] web_tree_image_tooltip: black, isort, prettier
parent
e36f1ee392
commit
48297b86a2
|
@ -0,0 +1 @@
|
||||||
|
../../../../web_tree_image_tooltip
|
|
@ -0,0 +1,6 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
|
@ -6,20 +6,16 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Show images in tree views via tooltip',
|
"name": "Show images in tree views via tooltip",
|
||||||
'version': '12.0.1.0.0',
|
"version": "12.0.1.0.0",
|
||||||
'author': "Therp BV, "
|
"author": "Therp BV, "
|
||||||
"MONK Software, "
|
"MONK Software, "
|
||||||
"Odoo Community Association (OCA), "
|
"Odoo Community Association (OCA), "
|
||||||
"Serpent Consulting Services Pvt. Ltd.",
|
"Serpent Consulting Services Pvt. Ltd.",
|
||||||
'website': 'https://github.com/OCA/web',
|
"website": "https://github.com/OCA/web",
|
||||||
'license': 'AGPL-3',
|
"license": "AGPL-3",
|
||||||
'category': 'Web',
|
"category": "Web",
|
||||||
'depends': [
|
"depends": ["web",],
|
||||||
'web',
|
"data": ["view/assets.xml",],
|
||||||
],
|
"installable": True,
|
||||||
'data': [
|
|
||||||
'view/assets.xml',
|
|
||||||
],
|
|
||||||
'installable': True,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
* Jay Vora <jay.vora@serpentcs.com>
|
* Jay Vora <jay.vora@serpentcs.com>
|
||||||
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
|
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
|
||||||
* Nikul Chaudhary <nikul.chaudhary.serpentcs@gmail.com>
|
* Nikul Chaudhary <nikul.chaudhary.serpentcs@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
|
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
This module defines a images and icons in tree view via Tooltip.
|
This module defines a images and icons in tree view via Tooltip.
|
||||||
Additionally, Default width with 30px.
|
Additionally, Default width with 30px.
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
Mouse Hover in tree view image that time Tooltip effect.
|
Mouse Hover in tree view image that time Tooltip effect.
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
odoo.define('web_tree_image_tooltip.web_tree_image_tooltip',
|
odoo.define("web_tree_image_tooltip.web_tree_image_tooltip", function(require) {
|
||||||
function (require) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var ListRenderer = require('web.ListRenderer');
|
var ListRenderer = require("web.ListRenderer");
|
||||||
ListRenderer.include({
|
ListRenderer.include({
|
||||||
events: _.extend({}, ListRenderer.prototype.events, {
|
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) {
|
_onHoverRecord_img: function(event) {
|
||||||
var img_src =
|
var img_src = $(event.currentTarget)
|
||||||
$(event.currentTarget).children('.img-fluid').attr('src')
|
.children(".img-fluid")
|
||||||
$(event.currentTarget).tooltip({
|
.attr("src");
|
||||||
title: "<img src="+img_src+" class='tooltip_image' />",
|
$(event.currentTarget)
|
||||||
delay: 0,
|
.tooltip({
|
||||||
}).tooltip('show');
|
title: "<img src=" + img_src + " class='tooltip_image' />",
|
||||||
}
|
delay: 0,
|
||||||
|
})
|
||||||
|
.tooltip("show");
|
||||||
|
},
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
.o_image_cell .o_field_image img{
|
.o_image_cell .o_field_image img {
|
||||||
width:30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip_image {
|
.tooltip_image {
|
||||||
max-width:80vw;
|
max-width: 80vw;
|
||||||
max-height:80vh;
|
max-height: 80vh;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
<template
|
||||||
<template id="assets_backend" name="tree icon assets" inherit_id="web.assets_backend">
|
id="assets_backend"
|
||||||
|
name="tree icon assets"
|
||||||
|
inherit_id="web.assets_backend"
|
||||||
|
>
|
||||||
<xpath expr="." position="inside">
|
<xpath expr="." position="inside">
|
||||||
<link rel='stylesheet' href='/web_tree_image_tooltip/static/src/scss/common.scss'/>
|
<link
|
||||||
<script type="text/javascript" src="/web_tree_image_tooltip/static/src/js/tooltip.js"/>
|
rel='stylesheet'
|
||||||
|
href='/web_tree_image_tooltip/static/src/scss/common.scss'
|
||||||
|
/>
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="/web_tree_image_tooltip/static/src/js/tooltip.js"
|
||||||
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
Loading…
Reference in New Issue