From f33ed6b1002b3fc0b39315b3e52621e6c86bf0f1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 4 Apr 2019 16:40:00 +0200 Subject: [PATCH] Show mouse scroll icon if only there's scroll left-right available on vfsPath container --- api/js/etemplate/et2_widget_vfs.js | 10 ++++++++++ api/templates/default/etemplate2.css | 2 ++ 2 files changed, 12 insertions(+) diff --git a/api/js/etemplate/et2_widget_vfs.js b/api/js/etemplate/et2_widget_vfs.js index b6d15af5b9..8d1a72eec1 100644 --- a/api/js/etemplate/et2_widget_vfs.js +++ b/api/js/etemplate/et2_widget_vfs.js @@ -295,6 +295,16 @@ var et2_vfsPath = (function(){ "use strict"; return et2_vfsName.extend( var delta = e.originalEvent.deltaY > 0 ? 30 : -30; this.scrollLeft = this.scrollLeft - delta; }); + this.span.on('mouseover', function (e){ + if (this.scrollWidth > this.clientWidth) + { + jQuery(this).addClass('scrollable'); + } + else + { + jQuery(this).removeClass('scrollable'); + } + }); this.input.on('focus', function() { this.input.val(this.options.value); this.span.hide(); diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 4694dc2820..ee527ef9e9 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -980,6 +980,8 @@ div.et2_vfsPath li { padding-top: 6px; color: #26537C; border-radius: 5px 0px 0px 5px; +} +div.et2_vfsPath ul.scrollable li { cursor: url(images/mouse_scroll_lr.svg) 20 1 , pointer; } li.vfsPath.et2_clickable:last-child:hover {