function tsWindowButtonUpFcn(eventSrc, eventData, h)

if strcmp(h.State,'None')
    return
end

if (strcmp(h.State,'TimeseriesScaling') || strcmp(h.State,'TimeseriesTranslating')) ...
        && ~isempty(h.SelectionStruct.StartPoint)
   
    %% Reset the state so that another time series can be selected
    if strcmp(h.State,'TimeseriesScaling')
        h.State = 'TimeseriesScale';
        h.scale([],'complete')
    elseif strcmp(h.State,'TimeseriesTranslating')
        h.State = 'TimeseriesTranslate';
        h.move([],'complete')
    end
    
    set(ancestor(h.AxesGrid.Parent,'Figure'),'Pointer','arrow')
%     h.draw
%     drawnow
elseif strcmp(h.State,'IntervalSelecting')
    h.State = 'IntervalSelect';
    set(h.waves,'RefreshMode','normal');
    h.draw
elseif strcmp(h.State,'TimeSelecting')
    h.State = 'TimeSelect';
    set(h.waves,'RefreshMode','normal');
    h.draw
end
    
%% Turn limit manager back on
h.AxesGrid.LimitManager = 'on';
h.AxesGrid.send('ViewChange')
