diff --git a/app/components/commander/action_modes.hbs b/app/components/commander/action_modes.hbs
index 5db1cd05044ba3e84a15dd7645baf37c53343f11..b4fd4527f6586aa8dd2528ff6ed0856149c67b79 100644
--- a/app/components/commander/action_modes.hbs
+++ b/app/components/commander/action_modes.hbs
@@ -5,7 +5,9 @@
<PanelModes
@dualPanelMode={{@dualPanelMode}}
- @hint={{@hint}} />
+ @hint={{@hint}}
+ @onSwapPanels={{@onSwapPanels}}
+ @onDuplicatePanel={{@onDuplicatePanel}} />
<div class="panel-mode">
<button type="button" class="btn btn-light mx-1"
diff --git a/app/components/commander/index.hbs b/app/components/commander/index.hbs
index 078428480651e3ec3ddf3cd496e16c5c69d66017..d7d38d0c842bd82f2efd602a14f6bf0aa1d1165c 100644
--- a/app/components/commander/index.hbs
+++ b/app/components/commander/index.hbs
@@ -37,7 +37,9 @@
@onPanelToggle={{@onPanelToggle}}
@dualPanelMode={{@dualPanelMode}}
@onViewModeChange={{this.onViewModeChange}}
- @hint={{@hint}} />
+ @hint={{@hint}}
+ @onSwapPanels={{@onSwapPanels}}
+ @onDuplicatePanel={{@onDuplicatePanel}} />
</div>
<Modal::NewFolder
diff --git a/app/components/panel_modes.hbs b/app/components/panel_modes.hbs
index 192f5841fb229ee20eb94f31c6c4a21b12deb27c..c00cfec808dcf62d060edf29cd43c03097d99209 100644
--- a/app/components/panel_modes.hbs
+++ b/app/components/panel_modes.hbs
@@ -1,18 +1,18 @@
{{#if @dualPanelMode}}
- {{#if (is_equal @hint "left")}}
- <button type="button"
- class="btn btn-light mx-1">
+ <button
+ type="button"
+ class="btn btn-light mx-1"
+ {{on 'click' @onDuplicatePanel}}>
+ {{#if (is_equal @hint "left")}}
<i class="bi-arrow-bar-right"></i>
- </button>
- {{else}}
- <button type="button"
- class="btn btn-light mx-1">
- <i class="bi-arrow-bar-left"></i>
- </button>
- {{/if}}
+ {{else}}
+ <i class="bi-arrow-bar-left"></i>
+ {{/if}}
+ </button>
<button type="button"
- class="btn btn-light mx-1">
+ class="btn btn-light mx-1"
+ {{on 'click' @onSwapPanels}}>
<i class="bi-arrow-left-right"></i>
</button>
{{/if}}
diff --git a/app/components/viewer/action_modes.hbs b/app/components/viewer/action_modes.hbs
index d0e4eea8d5499185b17c87f08479fcfcfb24e76a..40329f9ec116f4bb78befa4e99804a79abf6c453 100644
--- a/app/components/viewer/action_modes.hbs
+++ b/app/components/viewer/action_modes.hbs
@@ -2,7 +2,9 @@
<PanelModes
@dualPanelMode={{@dualPanelMode}}
- @hint={{@hint}} />
+ @hint={{@hint}}
+ @onSwapPanels={{@onSwapPanels}}
+ @onDuplicatePanel={{@onDuplicatePanel}} />
<div class="panel-mode">
<button type="button" class="btn btn-light mx-1"
diff --git a/app/components/viewer/index.hbs b/app/components/viewer/index.hbs
index b88d54ed669c80c6987e4ad6bab6d04d2b461dfa..693d352c88fd8c9e992c00f7586886d9620790cd 100644
--- a/app/components/viewer/index.hbs
+++ b/app/components/viewer/index.hbs
@@ -17,7 +17,9 @@
<Viewer::ActionModes
@onPanelToggle={{@onPanelToggle}}
@dualPanelMode={{@dualPanelMode}}
- @hint={{@hint}} />
+ @hint={{@hint}}
+ @onSwapPanels={{@onSwapPanels}}
+ @onDuplicatePanel={{@onDuplicatePanel}} />
</div>
<Viewer::ContextMenu
diff --git a/app/controllers/authenticated/nodes.js b/app/controllers/authenticated/nodes.js
index fd41b8f6f97d9ef8dedaa3818f57ad2042788ca4..490ff5d2724617dd378a1962b2dc073ee349a04b 100644
--- a/app/controllers/authenticated/nodes.js
+++ b/app/controllers/authenticated/nodes.js
@@ -1,9 +1,12 @@
import { action } from '@ember/object';
import DualPanelBaseController from "./dualpanel_base";
+import { service } from '@ember/service';
export default class NodesController extends DualPanelBaseController {
+ @service router;
+
@action
async onPanelToggle(hint) {
/*
@@ -16,9 +19,9 @@ export default class NodesController extends DualPanelBaseController {
if (hint === "left") {
// user decided to close left panel
if (this.extra_type === 'folder') {
- this.replaceRoute('authenticated.nodes', this.extra_id);
+ this.router.replaceWith('authenticated.nodes', this.extra_id);
} else {
- this.replaceRoute('authenticated.document', this.extra_id);
+ this.router.replaceWith('authenticated.document', this.extra_id);
}
this.extra_id = null;
this.extra_type = null;
@@ -37,16 +40,37 @@ export default class NodesController extends DualPanelBaseController {
@action
onSwapPanels() {
- console.log(`onSwapPanels`);
- }
+ let node_id;
- @action
- onLeftDuplicate() {
- console.log(`onLeftDuplicate`);
+ if (this.extra_id && this.extra_type == 'folder') {
+ node_id = this.router.currentRoute.params['node_id'];
+ this.router.transitionTo(
+ 'authenticated.nodes',
+ this.extra_id,
+ {
+ 'queryParams': {
+ 'extra_id': node_id,
+ 'extra_type': 'folder',
+ }
+ }
+ );
+ } else if (this.extra_id && this.extra_type == 'doc') {
+ node_id = this.router.currentRoute.params['node_id'];
+ this.router.transitionTo(
+ 'authenticated.document',
+ this.extra_id,
+ {
+ 'queryParams': {
+ 'extra_id': node_id,
+ 'extra_type': 'folder'
+ }
+ }
+ )
+ }
}
@action
- onRightDuplicate() {
- console.log(`onRightDuplicate`);
+ onDuplicatePanel() {
+ console.log(`onDuplicatePanel`);
}
}
diff --git a/app/templates/authenticated/nodes.hbs b/app/templates/authenticated/nodes.hbs
index 4a04596473e02c3016546133710c0083d43c19c7..6651b8a3428db9196a68880b372e16aec29c790c 100644
--- a/app/templates/authenticated/nodes.hbs
+++ b/app/templates/authenticated/nodes.hbs
@@ -8,7 +8,9 @@
@extradoc={{@model.extra.doc}}
@onPanelToggle={{this.onPanelToggle}}
@dualPanelMode={{this.dualpanel_mode}}
- @hint="left" />
+ @hint="left"
+ @onSwapPanels={{this.onSwapPanels}}
+ @onDuplicatePanel={{this.onDuplicatePanel}} />
{{#if @model.extra}}
{{#if @model.extra.doc}}
@@ -18,7 +20,9 @@
@extranode={{@model.current_node}}
@onPanelToggle={{this.onPanelToggle}}
@dualPanelMode={{this.dualpanel_mode}}
- @hint="right" />
+ @hint="right"
+ @onSwapPanels={{this.onSwapPanels}}
+ @onDuplicatePanel={{this.onDuplicatePanel}} />
{{else}}
<Commander
@node={{@model.extra.current_node}}
@@ -27,7 +31,9 @@
@extranode={{@model.current_node}}
@onPanelToggle={{this.onPanelToggle}}
@dualPanelMode={{this.dualpanel_mode}}
- @hint="right" />
+ @hint="right"
+ @onSwapPanels={{this.onSwapPanels}}
+ @onDuplicatePanel={{this.onDuplicatePanel}} />
{{/if}}
{{/if}}
</div>