onEmptyClick mode tree timeline

Hello,
i use onEmptyClick in timeline mode tree ,my problem is when i click to a parent or a unit onEmptyClick is running

i want to run onEmptyClick only in green space just to create event

this is the snipped code
https://snippet.dhtmlx.com/2b69ad022

Hi,

Use “e.target” value to check the clicked element.

hello,
thanks for your help
i added this code

  scheduler.attachEvent("onEmptyClick", function (date, e) {
    var target = e.target;
  if (target && target.className.indexOf("dhx_matrix_cell ") !== -1) {
    alert('testtttttt');
  }
    else
    {
     console.log('NNOO'); 
    }
                       
  });

it partially fixes the problem

the problem that the parent and the matrix cell have the same class : dhx_matrix_cell
how can I differentiate between them

this is the snipped code
https://snippet.dhtmlx.com/23d61d073

Hi,

You need to check also the parent element if it has “folder” class http://prntscr.com/ma2nxr