diff --git a/app/app/components/document/document-sidebar.js b/app/app/components/document/document-sidebar.js index a07e00bc..da57db26 100644 --- a/app/app/components/document/document-sidebar.js +++ b/app/app/components/document/document-sidebar.js @@ -22,6 +22,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { showContributions: false, showSections: false, showScrollTool: false, + showingSections: false, didRender() { if (this.session.authenticated) { @@ -85,6 +86,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', false); this.set('showSections', false); + + this.set('showingSections', false); }, showViews() { @@ -92,6 +95,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', true); this.set('showContributions', false); this.set('showSections', false); + + this.set('showingSections', false); }, showContributions() { @@ -99,6 +104,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', true); this.set('showSections', false); + + this.set('showingSections', false); }, showSections() { @@ -106,18 +113,24 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, { this.set('showViews', false); this.set('showContributions', false); this.set('showSections', true); + + this.set('showingSections', true); }, onCancel() { this.send('showToc'); + this.set('showingSections', false); }, onAddSection(section) { this.attrs.onAddSection(section); + + this.set('showingSections', false); }, scrollTop() { this.set('showScrollTool', false); + $("html,body").animate({ scrollTop: 0 }, 500, "linear"); diff --git a/app/app/templates/components/document/document-sidebar.hbs b/app/app/templates/components/document/document-sidebar.hbs index eec65770..4565e490 100644 --- a/app/app/templates/components/document/document-sidebar.hbs +++ b/app/app/templates/components/document/document-sidebar.hbs @@ -32,6 +32,11 @@
add
+ {{#if showingSections}} +
+ close +
+ {{/if}} {{/if}} {{#if showScrollTool}}