Allow user to be able to scroll nm headers, which have v-scrolbar, instead of always trigger resize

This commit is contained in:
Hadi Nategh 2015-05-11 11:20:43 +00:00
parent a4c50198f9
commit 7180be1840

View File

@ -121,13 +121,29 @@
// Bind the "mousemove" event in the "resize" namespace // Bind the "mousemove" event in the "resize" namespace
_elem.bind("mousemove.resize", function(e) { _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 // Bind the "mousedown" event in the "resize" namespace
_elem.bind("mousedown.resize", function(e) { _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 // 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 // Start the resizing
startResize(outerTable, _elem, function(_w) { startResize(outerTable, _elem, function(_w) {