Added ability to copy a page

In 'More' menu alongside move.
Allows you to move if you have permission to create within the new
target parent.
Closes #673
This commit is contained in:
Dan Brown
2018-04-14 18:00:16 +01:00
parent d34b91f2c9
commit 0f7b0ad45a
17 changed files with 243 additions and 57 deletions

View File

@ -7,7 +7,8 @@ class EntitySelector {
this.lastClick = 0;
let entityTypes = elem.hasAttribute('entity-types') ? elem.getAttribute('entity-types') : 'page,book,chapter';
this.searchUrl = window.baseUrl(`/ajax/search/entities?types=${encodeURIComponent(entityTypes)}`);
let entityPermission = elem.hasAttribute('entity-permission') ? elem.getAttribute('entity-permission') : 'view';
this.searchUrl = window.baseUrl(`/ajax/search/entities?types=${encodeURIComponent(entityTypes)}&permission=${encodeURIComponent(entityPermission)}`);
this.input = elem.querySelector('[entity-selector-input]');
this.searchInput = elem.querySelector('[entity-selector-search]');
@ -68,7 +69,6 @@ class EntitySelector {
onClick(event) {
let t = event.target;
console.log('click', t);
if (t.matches('.entity-list-item *')) {
event.preventDefault();