|
@@ -4,6 +4,7 @@ import loggerFactory from '@alias/logger';
|
|
|
|
|
|
|
|
import * as entities from 'entities';
|
|
import * as entities from 'entities';
|
|
|
import * as toastr from 'toastr';
|
|
import * as toastr from 'toastr';
|
|
|
|
|
+import { toastError } from '../util/apiNotification';
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:services:PageContainer');
|
|
const logger = loggerFactory('growi:services:PageContainer');
|
|
|
const scrollThresForSticky = 0;
|
|
const scrollThresForSticky = 0;
|
|
@@ -89,6 +90,19 @@ export default class PageContainer extends Container {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const unlinkPageButton = document.getElementById('unlink-page-button');
|
|
|
|
|
+ if (unlinkPageButton != null) {
|
|
|
|
|
+ unlinkPageButton.addEventListener('click', async() => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await this.appContainer.apiPost('/pages.unlink', { path });
|
|
|
|
|
+ window.location.href = encodeURI(`${res.path}?unlinked=true`);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ toastError(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.openPageDuplicateModal = this.openPageDuplicateModal.bind(this);
|
|
this.openPageDuplicateModal = this.openPageDuplicateModal.bind(this);
|
|
|
this.closePageDuplicateModal = this.closePageDuplicateModal.bind(this);
|
|
this.closePageDuplicateModal = this.closePageDuplicateModal.bind(this);
|
|
|
}
|
|
}
|