From 2b009c7a468bb073ce7298a5117d03a312805777 Mon Sep 17 00:00:00 2001 From: HemanginiPatel Date: Wed, 10 Jul 2019 12:12:22 +0530 Subject: [PATCH] [FIX][12.0] web_timeline: Scroll Issue. --- web_timeline/README.rst | 1 + web_timeline/readme/CONTRIBUTORS.rst | 1 + web_timeline/static/src/css/web_timeline.css | 32 +++++++++++++++++++ .../static/src/js/timeline_renderer.js | 11 ++++++- 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/web_timeline/README.rst b/web_timeline/README.rst index 16db743d..f25d3def 100755 --- a/web_timeline/README.rst +++ b/web_timeline/README.rst @@ -183,6 +183,7 @@ Contributors * Leonardo Donelli * Adrien Didenot * Dennis Sluijk +* Serpent Consulting Services Pvt. Ltd. Other credits ~~~~~~~~~~~~~ diff --git a/web_timeline/readme/CONTRIBUTORS.rst b/web_timeline/readme/CONTRIBUTORS.rst index 4a76c233..5fc0f53c 100644 --- a/web_timeline/readme/CONTRIBUTORS.rst +++ b/web_timeline/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * Leonardo Donelli * Adrien Didenot * Dennis Sluijk +* Serpent Consulting Services Pvt. Ltd. diff --git a/web_timeline/static/src/css/web_timeline.css b/web_timeline/static/src/css/web_timeline.css index d32d3616..89fa975a 100644 --- a/web_timeline/static/src/css/web_timeline.css +++ b/web_timeline/static/src/css/web_timeline.css @@ -29,3 +29,35 @@ left: 0px; top: 0px; } + +.vis-labelset { + position: relative; + width: 100%; + height: 100%; + overflow: visible !important; +} + +.vis-labelset .vis-label:first-child { + background: lightgrey; + position: sticky; + top: 0px !important; + z-index: 999; + max-height: 100px; + height: 100px !important; + display: -webkit-flex; +} + +.vis-foreground .vis-group:first-child { + background: lightgrey; + position: sticky; + top: 0px !important; + z-index: 999; + max-height: 100px; + height: 100px !important; + display: -webkit-flex; + overflow: auto; +} + +.vis-background .vis-group:nth-child(2) .vis-line{ + display:none !important; +} diff --git a/web_timeline/static/src/js/timeline_renderer.js b/web_timeline/static/src/js/timeline_renderer.js index 4a0038ce..b0e79059 100644 --- a/web_timeline/static/src/js/timeline_renderer.js +++ b/web_timeline/static/src/js/timeline_renderer.js @@ -210,7 +210,10 @@ odoo.define('web_timeline.TimelineRenderer', function (require) { onAdd: self.on_add, onMove: self.on_move, onUpdate: self.on_update, - onRemove: self.on_remove + onRemove: self.on_remove, + horizontalScroll: false, + verticalScroll:true, + zoomKey: 'ctrlKey', }); this.qweb = new QWeb(session.debug, {_s: session.origin}, false); if (this.arch.children.length) { @@ -223,6 +226,12 @@ odoo.define('web_timeline.TimelineRenderer', function (require) { } this.timeline = new vis.Timeline(self.$timeline.empty().get(0)); + $(this.timeline.dom.leftContainer).scroll(function() { + var hei = ($('.vis-foreground .vis-group:first-child')[0].style.height).split("px"); + var itemset_height = ($('.vis-itemset')[0].style.height).split("px"); + var new_height = parseInt(itemset_height[0]) - (parseInt(hei[0]) - 100) + $('.vis-itemset').css('height', new_height) + }); this.timeline.setOptions(this.options); if (self.mode && self['on_scale_' + self.mode + '_clicked']) { self['on_scale_' + self.mode + '_clicked']();