Commit 64723ac1 authored by Henning Leutz's avatar Henning Leutz 🥋

feat: #522 -> added Show side in structure

parent 9a25d4e6
......@@ -13,7 +13,16 @@
<span class="field-container-item">
{locale group="quiqqer/system" var="projects.project.site.panel.information.title"}
</span>
<input name="title" value="" class="field-container-field"/>
<button type="button"
name="open-in-structure"
class="qui-button site-open-in-structure field-container-field"
style="width: 50px; flex:inherit;"
disabled
>
<span class="fa fa-sitemap"></span>
</button>
</label>
</td>
</tr>
......
......@@ -79,18 +79,18 @@ define('controls/projects/project/Panel', [
title: Locale.get('quiqqer/system', 'projects.project.panel.title')
});
this.$Map = null;
this.$Map = null;
this.$projectmaps = {};
this.$Filter = null;
this.$Button = null;
this.$Filter = null;
this.$Button = null;
this.$ProjectList = null;
this.$ProjectList = null;
this.$ProjectContainer = null;
this.$ProjectSearch = null;
this.$ProjectContent = null;
this.$ProjectSearch = null;
this.$ProjectContent = null;
this.$LanguageSelect = null;
this.$MediaButton = null;
this.$MediaButton = null;
this.$__fx_run = false;
......@@ -165,9 +165,9 @@ define('controls/projects/project/Panel', [
Content.setStyle('opacity', 0);
this.$ProjectContainer = Content.getElement('.project-container');
this.$ProjectList = Content.getElement('.project-list');
this.$ProjectSearch = Content.getElement('.project-search');
this.$ProjectContent = Content.getElement('.project-content');
this.$ProjectList = Content.getElement('.project-list');
this.$ProjectSearch = Content.getElement('.project-search');
this.$ProjectContent = Content.getElement('.project-content');
this.$ProjectContainer.setStyles({
height: 'calc(100% - 40px)'
......@@ -644,10 +644,11 @@ define('controls/projects/project/Panel', [
* Opens the selected Project and create a Project Sitemap in the Panel
*
* @method controls/projects/project/Panel#openProject
* @return {Promise}
*/
openProject: function () {
if (this.$__fx_run) {
return;
return Promise.resolve();
}
this.$__fx_run = true;
......@@ -682,7 +683,7 @@ define('controls/projects/project/Panel', [
onChildClick : this.$openSitePanel,
onChildContextMenu: function (Item, MapItem, event) {
var title = MapItem.getAttribute('text') + ' - ' +
MapItem.getAttribute('value');
MapItem.getAttribute('value');
MapItem.getContextMenu().setTitle(title).setPosition(
event.page.x,
......@@ -709,7 +710,7 @@ define('controls/projects/project/Panel', [
this.$LanguageSelect.disable();
this.$MediaButton.enable();
Project.getConfig(false, 'langs').then(function (langs) {
return Project.getConfig(false, 'langs').then(function (langs) {
langs = langs.split(',');
if (!langs.length) {
......@@ -727,23 +728,25 @@ define('controls/projects/project/Panel', [
self.$LanguageSelect.enable();
self.$LanguageSelect.setValue(Project.getLang());
});
});
List.setStyle('boxShadow', '0 6px 20px 0 rgba(0, 0, 0, 0.19)');
moofx(List).animate({
left : List.getSize().x * -1,
opacity: 0
}, {
equation: 'ease-out',
duration: 300,
callback: function () {
Container.setStyle('overflow', null);
List.setStyle('display', 'none');
self.$Map.open();
self.$__fx_run = false;
}
List.setStyle('boxShadow', '0 6px 20px 0 rgba(0, 0, 0, 0.19)');
}).then(function () {
return new Promise(function (resolve) {
moofx(List).animate({
left : List.getSize().x * -1,
opacity: 0
}, {
equation: 'ease-out',
duration: 300,
callback: function () {
Container.setStyle('overflow', null);
List.setStyle('display', 'none');
self.$Map.open().then(resolve);
self.$__fx_run = false;
}
});
});
});
},
......
......@@ -169,10 +169,10 @@ define('controls/projects/project/Sitemap', [
var self = this;
self.$loadUsersSettings().then(function () {
return self.$loadUsersSettings().then(function () {
// if an specific id must be open
if (typeof self.$openids !== 'undefined' && self.$Map.firstChild()) {
var First = this.$Map.firstChild();
var First = self.$Map.firstChild();
if (First.isOpen()) {
self.fireEvent('openEnd', [First, self]);
......
......@@ -42,6 +42,13 @@
box-shadow: none;
}
.site-open-in-structure {
border: 1px solid #DEDEDE !important;
border-radius: 0 !important;
box-shadow: none !important;
outline: none;
}
.site-url-display {
clear: both;
display: inline-block;
......
......@@ -68,6 +68,7 @@ define('controls/projects/project/site/Panel', [
'openSort',
'deleteLinked',
'openSiteInPopup',
'openSiteInStructure',
'$onCreate',
'$onDestroy',
......@@ -196,6 +197,33 @@ define('controls/projects/project/site/Panel', [
);
},
/**
* Opens the site in the project panel
*/
openSiteInStructure: function () {
var Panel;
var projectPanels = QUI.Controls.getByType('controls/projects/project/Panel');
var Site = this.getSite(),
Project = Site.getProject();
for (var i = 0, len = projectPanels.length; i < len; i++) {
Panel = projectPanels[i];
if (Panel.getAttribute('project') === Project.getName() &&
Panel.getAttribute('lang') === Project.getLang()) {
Panel.openSite(Site.getId());
continue;
}
Panel.setAttribute('project', Project.getName());
Panel.setAttribute('lang', Project.getLang());
Panel.openProject().then(function () {
Panel.openSite(Site.getId());
});
}
},
/**
* Load the site attributes to the panel
*
......@@ -1007,9 +1035,14 @@ define('controls/projects/project/site/Panel', [
var LinkinTable = Body.getElement('.site-linking'),
LinkinLangTable = Body.getElement('.site-langs'),
Locked = Body.getElement('[data-locked]'),
Title = Body.getElement('[name="title"]')
Title = Body.getElement('[name="title"]'),
OpenInStructure = Body.getElement('[name="open-in-structure"]')
;
OpenInStructure.addEvent('click', self.openSiteInStructure);
OpenInStructure.set('disabled', false);
OpenInStructure.set('title', Locale.get('quiqqer/quiqqer', 'projects.project.site.panel.information.openInSiteStructure'));
Title.addEvent('blur', function () {
if (Site.getId() === 1) {
return;
......
......@@ -4590,6 +4590,9 @@
<locale name="projects.project.site.panel.information.nameUrl">
<de><![CDATA[Name / URL]]></de>
</locale>
<locale name="projects.project.site.panel.information.openInSiteStructure">
<de><![CDATA[In Seitenstruktur öffnen]]></de>
</locale>
<locale name="projects.project.site.panel.information.title">
<de><![CDATA[Titel]]></de>
</locale>
......
......@@ -4424,6 +4424,9 @@
<locale name="projects.project.site.panel.information.nameUrl">
<en><![CDATA[Name / URL]]></en>
</locale>
<locale name="projects.project.site.panel.information.openInSiteStructure">
<en><![CDATA[Open in page structure]]></en>
</locale>
<locale name="projects.project.site.panel.information.title">
<en><![CDATA[Title]]></en>
</locale>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment