mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49: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,
|
showContributions: false,
|
||||||
showSections: false,
|
showSections: false,
|
||||||
showScrollTool: false,
|
showScrollTool: false,
|
||||||
|
showingSections: false,
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
if (this.session.authenticated) {
|
if (this.session.authenticated) {
|
||||||
|
@ -85,6 +86,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
this.set('showViews', false);
|
this.set('showViews', false);
|
||||||
this.set('showContributions', false);
|
this.set('showContributions', false);
|
||||||
this.set('showSections', false);
|
this.set('showSections', false);
|
||||||
|
|
||||||
|
this.set('showingSections', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
showViews() {
|
showViews() {
|
||||||
|
@ -92,6 +95,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
this.set('showViews', true);
|
this.set('showViews', true);
|
||||||
this.set('showContributions', false);
|
this.set('showContributions', false);
|
||||||
this.set('showSections', false);
|
this.set('showSections', false);
|
||||||
|
|
||||||
|
this.set('showingSections', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
showContributions() {
|
showContributions() {
|
||||||
|
@ -99,6 +104,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
this.set('showViews', false);
|
this.set('showViews', false);
|
||||||
this.set('showContributions', true);
|
this.set('showContributions', true);
|
||||||
this.set('showSections', false);
|
this.set('showSections', false);
|
||||||
|
|
||||||
|
this.set('showingSections', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
showSections() {
|
showSections() {
|
||||||
|
@ -106,18 +113,24 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
this.set('showViews', false);
|
this.set('showViews', false);
|
||||||
this.set('showContributions', false);
|
this.set('showContributions', false);
|
||||||
this.set('showSections', true);
|
this.set('showSections', true);
|
||||||
|
|
||||||
|
this.set('showingSections', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel() {
|
onCancel() {
|
||||||
this.send('showToc');
|
this.send('showToc');
|
||||||
|
this.set('showingSections', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
onAddSection(section) {
|
onAddSection(section) {
|
||||||
this.attrs.onAddSection(section);
|
this.attrs.onAddSection(section);
|
||||||
|
|
||||||
|
this.set('showingSections', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollTop() {
|
scrollTop() {
|
||||||
this.set('showScrollTool', false);
|
this.set('showScrollTool', false);
|
||||||
|
|
||||||
$("html,body").animate({
|
$("html,body").animate({
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}, 500, "linear");
|
}, 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">
|
<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>
|
<i class="material-icons color-green">add</i>
|
||||||
</div>
|
</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}}
|
||||||
|
|
||||||
{{#if showScrollTool}}
|
{{#if showScrollTool}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue