From 448fe5b6a80a361fa33f6438888087392656544f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 11 May 2015 12:29:42 +0000 Subject: [PATCH] Allow user to be able to scroll nm headers, which have v-scrolbar, instead of always trigger resize --- etemplate/js/et2_dataview_view_resizeable.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_dataview_view_resizeable.js b/etemplate/js/et2_dataview_view_resizeable.js index 0112a131cd..98ea84fff4 100644 --- a/etemplate/js/et2_dataview_view_resizeable.js +++ b/etemplate/js/et2_dataview_view_resizeable.js @@ -121,13 +121,29 @@ // Bind the "mousemove" event in the "resize" namespace _elem.bind("mousemove.resize", function(e) { - _elem.css("cursor", inResizeRegion(e.pageX, _elem) ? "ew-resize" : "auto"); + var stopResize = false; + // Stop switch to resize cursor if the mouse position + // is more intended for scrollbar not the resize edge + // 8pixel is an arbitary number for scrolbar area + if (e.target.clientHeight < e.target.scrollHeight && e.target.offsetWidth - e.offsetX <= 8) + { + stopResize = true; + } + _elem.css("cursor", inResizeRegion(e.pageX, _elem) && !stopResize? "ew-resize" : "auto"); }); // Bind the "mousedown" event in the "resize" namespace _elem.bind("mousedown.resize", function(e) { + var stopResize = false; + // Stop resize if the mouse position is more intended + // for scrollbar not the resize edge + // 8pixel is an arbitary number for scrolbar area + if (e.target.clientHeight < e.target.scrollHeight && e.target.offsetWidth - e.offsetX <= 8) + { + stopResize = true; + } // Do not triger startResize if clicked element is select-tag, as it may causes conflict in some browsers - if (inResizeRegion(e.pageX, _elem) && e.target.tagName != 'SELECT') + if (inResizeRegion(e.pageX, _elem) && e.target.tagName != 'SELECT' && !stopResize) { // Start the resizing startResize(outerTable, _elem, function(_w) {