Browse Source

Closes #172

Closes #175
pull/177/head
Sebastian Stehle 9 years ago
parent
commit
af201cd985
  1. 3
      src/Squidex/Controllers/Api/Ping/PingController.cs
  2. 6
      src/Squidex/app/features/api/pages/graphql/graphql-page.component.scss
  3. 25
      src/Squidex/app/framework/angular/panel-container.directive.ts
  4. 9
      src/Squidex/app/framework/angular/panel.component.ts

3
src/Squidex/Controllers/Api/Ping/PingController.cs

@ -25,6 +25,7 @@ namespace Squidex.Controllers.Api.Ping
/// <summary>
/// Get ping status.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <returns>
/// 204 => Service ping successful.
/// </returns>
@ -34,7 +35,7 @@ namespace Squidex.Controllers.Api.Ping
[HttpGet]
[Route("ping/{app}/")]
[ApiCosts(0)]
public IActionResult GetPing()
public IActionResult GetPing(string app)
{
return NoContent();
}

6
src/Squidex/app/features/api/pages/graphql/graphql-page.component.scss

@ -9,4 +9,8 @@
.graphiql-container > * {
box-sizing: content-box;
}
& .editorWrap {
overflow: hidden;
}
}

25
src/Squidex/app/framework/angular/panel-container.directive.ts

@ -25,7 +25,7 @@ export class PanelContainerDirective implements AfterViewInit, OnDestroy {
@HostListener('window:resize')
public onResize() {
this.invalidate();
this.invalidate(true);
}
public ngOnDestroy() {
@ -33,7 +33,7 @@ export class PanelContainerDirective implements AfterViewInit, OnDestroy {
}
public ngAfterViewInit() {
this.invalidate({ force: true, resize: true });
this.invalidate(true);
}
public push(panel: PanelComponent) {
@ -48,14 +48,8 @@ export class PanelContainerDirective implements AfterViewInit, OnDestroy {
this.invalidate();
}
public invalidate(params?: { force: boolean, resize: boolean }) {
this.isInit = this.isInit || (params && params.force) === true;
if (!this.isInit) {
return;
}
if (params && params.resize) {
public invalidate(resize = false) {
if (resize) {
this.containerWidth = this.element.nativeElement.getBoundingClientRect().width;
}
@ -67,21 +61,22 @@ export class PanelContainerDirective implements AfterViewInit, OnDestroy {
for (let panel of this.panels) {
const panelRoot = panel.panel.nativeElement;
let width = panel.desiredWidth;
let layoutWidth = '';
if (panel.desiredWidth === '*' && panel === last) {
panel.actualWidth = this.containerWidth - currentPosition;
panel.desiredWidth = width + 'px';
layoutWidth = (this.containerWidth - currentPosition) + 'px';
} else {
layoutWidth = panel.desiredWidth;
}
this.renderer.setElementStyle(panelRoot, 'top', '0px');
this.renderer.setElementStyle(panelRoot, 'left', currentPosition + 'px');
this.renderer.setElementStyle(panelRoot, 'width', layoutWidth);
this.renderer.setElementStyle(panelRoot, 'bottom', '0px');
this.renderer.setElementStyle(panelRoot, 'position', 'absolute');
this.renderer.setElementStyle(panelRoot, 'z-index', currentLayer.toString());
currentPosition += panel.actualWidth;
currentPosition += panel.renderWidth;
currentLayer -= 10;
}

9
src/Squidex/app/framework/angular/panel.component.ts

@ -14,7 +14,7 @@ import { PanelContainerDirective } from './panel-container.directive';
@Component({
selector: 'sqx-panel',
template: `
<div [style.width]="desiredWidth" [attr.expand]="expand" #panel>
<div #panel>
<div class="panel panel-{{theme}}" [@slideRight]>
<ng-content></ng-content>
</div>
@ -24,7 +24,7 @@ import { PanelContainerDirective } from './panel-container.directive';
]
})
export class PanelComponent implements AfterViewInit, OnDestroy, OnInit {
public actualWidth = 0;
public renderWidth = 0;
@Input()
public theme = 'light';
@ -32,9 +32,6 @@ export class PanelComponent implements AfterViewInit, OnDestroy, OnInit {
@Input()
public desiredWidth = '10rem';
@Input()
public expand = false;
@ViewChild('panel')
public panel: ElementRef;
@ -52,7 +49,7 @@ export class PanelComponent implements AfterViewInit, OnDestroy, OnInit {
}
public ngAfterViewInit() {
this.actualWidth = this.panel.nativeElement.getBoundingClientRect().width;
this.renderWidth = this.panel.nativeElement.getBoundingClientRect().width;
this.container.invalidate();
}

Loading…
Cancel
Save