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

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

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

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

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

Loading…
Cancel
Save