$document.on('notesPanelVisibilityChanged', function(e, visible) {
setVisibility(visible);
if (visible) {
noteManager.alignViews();
resize();
} else {
// makes sure that the bottom margin is correct when the panel is closed
// as it may have been enlarged because of many notes
noteManager.updateBottomMargin();
noteManager.hideFocusConnector();
}
});