mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
add section close button
This commit is contained in:
parent
459469c1d4
commit
bed6271d0d
2 changed files with 18 additions and 0 deletions
|
@ -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");
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue