1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 05:39:42 +02:00

add section close button

This commit is contained in:
Harvey Kandola 2016-10-05 18:08:10 -07:00
parent 459469c1d4
commit bed6271d0d
2 changed files with 18 additions and 0 deletions

View file

@ -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");

View file

@ -32,6 +32,11 @@
<div {{action 'showSections'}} id="section-tool" class="round-button round-button-mono button-white section-tool" data-tooltip="Add content" data-tooltip-position="top center">
<i class="material-icons color-green">add</i>
</div>
{{#if showingSections}}
<div {{action 'onCancel'}} id="cancel-tool" class="round-button round-button-mono button-white section-tool">
<i class="material-icons color-gray">close</i>
</div>
{{/if}}
{{/if}}
{{#if showScrollTool}}