function dropCallback(h, varargin)


%% Find selected axes
thisaxespos = [];
if ishandle(h.Plot)
    drawnow % Needed for HG to update the current point
    drawnow
    
    % Get current fig pos in normalized units
    figunits = get(h.Plot.AxesGrid.Parent','Units');
    set(ancestor(h.Plot.AxesGrid.Parent,'figure'),'Units','normalized');
    uipanelpos = get(h.Plot.AxesGrid.Parent,'Position');
    
    % Get current position in normalized units
    thispos = get(ancestor(h.Plot.AxesGrid.Parent,'figure'),'CurrentPoint');   
    set(ancestor(h.Plot.AxesGrid.Parent,'figure'),'Units',figunits);
    
    % Loop through each axes to see if it's the one
    theseaxes = h.plot.axesgrid.getaxes;
    for k=1:length(theseaxes)
        % Compute axes pos in fig coorrdinates
        thisaxescoord = [theseaxes(k).Position(1:2).*uipanelpos(3:4)+...
            uipanelpos(1:2), theseaxes(k).Position(3:4).*uipanelpos(3:4)];
            
        if thispos(1)>=thisaxescoord(1) && ...
                thispos(2)>=thisaxescoord(2) && ...
                thispos(1)<=thisaxescoord(1)+thisaxescoord(3) && ...
                thispos(2)<=thisaxescoord(2)+thisaxescoord(4)
            thisaxespos = k;
            break
        end
    end
end

%% Drop action callback - common to all view nodes
selNodes = getSelectedNodes(handle(h.Tree));
if length(selNodes)==1
    tsNode = get(selNodes(1),'Value');
    % Bring the view figure to the front
    figure(double(h.Figure));
    if ~isempty(tsNode)
        tsNode = handle(tsNode);
        % Call the appropriate addTs method
        if isempty(thisaxespos)
            h.addTs(tsNode.TimeSeries);
        else
            h.addTs(tsNode.TimeSeries,thisaxespos);
        end
    end
    
    % Bring the current plot into focus
    figure(ancestor(h.Plot.AxesGrid.Parent,'figure'));
end

