From 80683de06d71c465632b02f5dbbb9d62f46df9d2 Mon Sep 17 00:00:00 2001 From: Marco Crespi Date: Mon, 4 Dec 2017 16:32:45 +0100 Subject: [PATCH] fix(gridfield): Show context menu when clicking anywhere in the treenav column --- javascript/GridFieldPageSectionsExtension.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/GridFieldPageSectionsExtension.js b/javascript/GridFieldPageSectionsExtension.js index a1b2acb..dbf35aa 100644 --- a/javascript/GridFieldPageSectionsExtension.js +++ b/javascript/GridFieldPageSectionsExtension.js @@ -50,11 +50,11 @@ var grid = this.getGridField(); var id = grid.data("id"); var rowId = $target.parents(".ss-gridfield-item").data("id"); - var $treeNav = $target.parents(".col-treenav").first(); + var $treeNav = $target.hasClass("col-treenav") ? $target : + $target.parents(".col-treenav").first(); - if ($treeNav.length <= 0) { - return; - } + // If we don't have a col-treenav the user clicked on another column + if ($treeNav.length <= 0) return; event.preventDefault(); var parentId = null;