fix document title click action based on whether the sharebar is shown and whether the doc is a template
Merge branch 'bert' into testing