mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-01 14:42:14 +00:00
Add close button to integrations manager
This commit is contained in:
parent
af2f5ba393
commit
5c74989604
@ -14,6 +14,7 @@ import { ScalarService } from "./shared/scalar.service";
|
|||||||
import { ToasterModule } from "angular2-toaster";
|
import { ToasterModule } from "angular2-toaster";
|
||||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||||
import { IntegrationComponent } from "./integration/integration.component";
|
import { IntegrationComponent } from "./integration/integration.component";
|
||||||
|
import { ScalarCloseComponent } from "./riot/scalar-close/scalar-close.component";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -31,6 +32,7 @@ import { IntegrationComponent } from "./integration/integration.component";
|
|||||||
HomeComponent,
|
HomeComponent,
|
||||||
RiotComponent,
|
RiotComponent,
|
||||||
IntegrationComponent,
|
IntegrationComponent,
|
||||||
|
ScalarCloseComponent,
|
||||||
|
|
||||||
// Vendor
|
// Vendor
|
||||||
],
|
],
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
<my-scalar-close></my-scalar-close>
|
||||||
<div *ngIf="error">
|
<div *ngIf="error">
|
||||||
<p class="text-danger">{{ error }}</p>
|
<p class="text-danger">{{ error }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,3 +6,8 @@
|
|||||||
#wrapper {
|
#wrapper {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my-scalar-close {
|
||||||
|
float: right;
|
||||||
|
margin: -15px;
|
||||||
|
}
|
1
web/app/riot/scalar-close/scalar-close.component.html
Normal file
1
web/app/riot/scalar-close/scalar-close.component.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<img src="/img/close.svg" (click)="closeScalar()">
|
4
web/app/riot/scalar-close/scalar-close.component.scss
Normal file
4
web/app/riot/scalar-close/scalar-close.component.scss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// component styles are encapsulated and only applied to their components
|
||||||
|
img {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
17
web/app/riot/scalar-close/scalar-close.component.ts
Normal file
17
web/app/riot/scalar-close/scalar-close.component.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { Component } from "@angular/core";
|
||||||
|
import { ScalarService } from "../../shared/scalar.service";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-scalar-close',
|
||||||
|
templateUrl: './scalar-close.component.html',
|
||||||
|
styleUrls: ['./scalar-close.component.scss'],
|
||||||
|
})
|
||||||
|
export class ScalarCloseComponent {
|
||||||
|
|
||||||
|
constructor(private scalar: ScalarService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public closeScalar() {
|
||||||
|
this.scalar.close();
|
||||||
|
}
|
||||||
|
}
|
@ -30,6 +30,10 @@ export class ScalarService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public close(): void {
|
||||||
|
this.callAction("close_scalar", {});
|
||||||
|
}
|
||||||
|
|
||||||
private callAction(action, payload) {
|
private callAction(action, payload) {
|
||||||
let requestKey = randomString({length: 20});
|
let requestKey = randomString({length: 20});
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
15
web/public/img/close.svg
Normal file
15
web/public/img/close.svg
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: sketchtool 39.1 (31720) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>00C6DB7A-67D6-4431-8FB5-07BB1C1AE079</title>
|
||||||
|
<desc>Created with sketchtool.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Scalar" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="vector_integrations_popup" transform="translate(-884.000000, -156.000000)">
|
||||||
|
<g id="icons_close" transform="translate(884.000000, 156.000000)">
|
||||||
|
<path d="M17.5,35 C27.1649831,35 35,27.1649831 35,17.5 C35,7.83501688 27.1649831,0 17.5,0 C7.83501688,0 0,7.83501688 0,17.5 C0,27.1649831 7.83501688,35 17.5,35 Z" id="Oval-1-Copy-7" fill="#EEECEC"></path>
|
||||||
|
<polyline id="icon_close" fill="#535353" opacity="0.9" transform="translate(17.468897, 17.470577) rotate(-315.000000) translate(-17.468897, -17.470577) " points="18.2115394 5.97057742 16.674774 5.97057742 16.674774 16.7275762 5.9688975 16.7275762 5.9688975 18.2642903 16.674774 18.2642903 16.674774 28.9705774 18.2115394 28.9705774 18.2115394 18.2642903 28.9688975 18.2642903 28.9688975 16.7275762 18.2115394 16.7275762 18.2115394 5.97057742"></polyline>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user