docs: function(node, inDragLayer) {
        // find top-level parent
        var parent = node;
  
        while (parent.parent().nonempty())
        {
          parent = parent.parent()[0];
  
          // var pstyle = parent._private.style;
          // if( pstyle.width.value !== 'auto' || pstyle.height.value !== 'auto' ){
          //   parent = node;
          //   break;
          // }
        }
  
        // no parent node: no node to add to the drag layer
        if (parent == node && inDragLayer)
        {
          return;
        }
  
        var nodes = parent.descendants().add(parent);
  
        for (var i=0; i < nodes.size(); i++)
        {
  
          nodes[i]._private.rscratch.inDragLayer = inDragLayer;
  
          // TODO when calling this function for a set of nodes, we visit same edges over and over again,
          // instead of adding edges for each node, it may be better to iterate all edges at once
          // or another solution is to find out the common ancestors and process only those nodes for edges
          for (var j=0; j<nodes[i]._private.edges.length; j++) {
            nodes[i]._private.edges[j]._private.rscratch.inDragLayer = inDragLayer;
          }
        }
      }