Skip to content
Snippets Groups Projects
Commit 69937e06 authored by Eugen Ciur's avatar Eugen Ciur
Browse files

show dual panel's action modes only when necessary

parent c14ad6f7
Branches
No related tags found
No related merge requests found
{{#if @dualPanelMode}}
<button
type="button"
class="btn btn-light mx-1"
{{on 'click' @onDuplicatePanel}}>
{{#if (is_equal @hint "left")}}
<i class="bi-arrow-bar-right"></i>
{{else}}
<i class="bi-arrow-bar-left"></i>
{{/if}}
</button>
<button type="button"
class="btn btn-light mx-1"
{{on 'click' @onSwapPanels}}>
<i class="bi-arrow-left-right"></i>
</button>
{{/if}}
{{#if this.are_not_same_panels }}
{{#if @dualPanelMode}}
<button
type="button"
class="btn btn-light mx-1"
{{on 'click' @onDuplicatePanel}}>
{{#if (is_equal @hint "left")}}
<i class="bi-arrow-bar-right"></i>
{{else}}
<i class="bi-arrow-bar-left"></i>
{{/if}}
</button>
<button type="button"
class="btn btn-light mx-1"
{{on 'click' @onSwapPanels}}>
<i class="bi-arrow-left-right"></i>
</button>
{{/if}}
{{/if}}
import Component from '@glimmer/component';
import { service } from '@ember/service';
export default class PanelModesComponent extends Component {
@service router;
get are_not_same_panels() {
/* Returns true if both panels are not same (non empty) values */
let param, query_param, route;
route = this.router.currentRoute;
param = route.params.document_id || route.params.node_id;
query_param = route.queryParams.extra_id;
if (param && query_param) {
return param !== query_param;
}
return true;
}
}
\ No newline at end of file
......@@ -77,7 +77,6 @@ export default class DocumentController extends DualPanelBaseController {
'extra_type': 'doc'
}
}
if (this.extra_id) {
this.router.transitionTo(
'authenticated.document',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment