Reload image on change
This commit is contained in:
parent
2f1c5210ea
commit
cabdeaa875
16
package-lock.json
generated
16
package-lock.json
generated
@ -1865,23 +1865,25 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@farmmaps/common": {
|
"@farmmaps/common": {
|
||||||
"version": "file:dist/common",
|
"version": "0.0.1-prerelease.548",
|
||||||
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.548.tgz",
|
||||||
|
"integrity": "sha512-gI+5kwpdimDkJUqU51PsyfZ0My5QRrEtwHGpCivd4kHxBZJ053cz6vHFnH1HquxesIXBVmDxjyeYGCrxhXVIOA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@farmmaps/common-map": {
|
"@farmmaps/common-map": {
|
||||||
"version": "0.0.1-prerelease.542",
|
"version": "0.0.1-prerelease.548",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.542.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.548.tgz",
|
||||||
"integrity": "sha512-UTz3FnIKEJ9PGgGTGy8UuWqY+ZBY6cW4oIL9VgHrUg9yXtfRt2zT9kaNDTeSUVOiLWcocGbJZX7zt5gjM/50PQ==",
|
"integrity": "sha512-rrlYUZvq4r1ANlbinucdasy5iRidOt8DI9V7ra4pKcgZqlsD5hteeosX45DnDlbSvcNzTtY3A0E28e4WXd25jA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@farmmaps/common-map3d": {
|
"@farmmaps/common-map3d": {
|
||||||
"version": "0.0.1-prerelease.542",
|
"version": "0.0.1-prerelease.548",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-0.0.1-prerelease.542.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-0.0.1-prerelease.548.tgz",
|
||||||
"integrity": "sha512-igy1g7ritVE2+hgc6jIO4+OriCeV6k2MubQcoszWWG4F6RZYuMgKciIWSdlDZ8yvZsA8WMdtxlT5vJ3wgvmesA==",
|
"integrity": "sha512-l3XQMSclt6x0fIjKw4K9j1IAr+L+0alHLd/9p80jfCkhB0qo1jZf/TorA636PSYB9NIBioiXOKMDVqTuPi+s/w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
"@angular/platform-browser": "~10.2.4",
|
"@angular/platform-browser": "~10.2.4",
|
||||||
"@angular/platform-browser-dynamic": "~10.2.4",
|
"@angular/platform-browser-dynamic": "~10.2.4",
|
||||||
"@angular/router": "~10.2.4",
|
"@angular/router": "~10.2.4",
|
||||||
"@farmmaps/common": "file:dist/common",
|
"@farmmaps/common": ">=0.0.1-prerelease.548 <0.0.1",
|
||||||
"@farmmaps/common-map": ">=0.0.1-prerelease.540 <0.0.1",
|
"@farmmaps/common-map": ">=0.0.1-prerelease.548 <0.0.1",
|
||||||
"@farmmaps/common-map3d": ">=0.0.1-prerelease.540 <0.0.1",
|
"@farmmaps/common-map3d": ">=0.0.1-prerelease.548 <0.0.1",
|
||||||
"@microsoft/signalr": "^3.1.3",
|
"@microsoft/signalr": "^3.1.3",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^7.0",
|
"@ng-bootstrap/ng-bootstrap": "^7.0",
|
||||||
"@ngrx/effects": "^10.0",
|
"@ngrx/effects": "^10.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div *ngIf="item;let item">
|
<div *ngIf="item;let item">
|
||||||
<div class="card border-0">
|
<div class="card border-0">
|
||||||
<fm-thumbnail [item]="item" [edit]="true"></fm-thumbnail>
|
<fm-thumbnail [item]="item" [edit]="item.isEditable"></fm-thumbnail>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
@ -56,7 +56,7 @@ export class EditImageModalComponent implements OnInit {
|
|||||||
this.imageService.putImage(this.endpointUrl,this.imageService.b64toBlob(body,"image/jpeg")).subscribe(() => {
|
this.imageService.putImage(this.endpointUrl,this.imageService.b64toBlob(body,"image/jpeg")).subscribe(() => {
|
||||||
this.changed.emit({});
|
this.changed.emit({});
|
||||||
});
|
});
|
||||||
(this.modal as any).close('Save click');
|
this,this.modalService.dismissAll("Save");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component,Input ,ViewChild,ElementRef} from '@angular/core';
|
import { Component,Input ,ViewChild,ElementRef,ChangeDetectorRef} from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
import { IListItem } from '../../models/list.item';
|
import { IListItem } from '../../models/list.item';
|
||||||
@ -19,7 +19,7 @@ import { AppConfig } from "../../shared/app.config";
|
|||||||
@ViewChild('thumbnail') el:ElementRef;
|
@ViewChild('thumbnail') el:ElementRef;
|
||||||
@ViewChild('modal') modal:EditImageModalComponent;
|
@ViewChild('modal') modal:EditImageModalComponent;
|
||||||
|
|
||||||
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,) {
|
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,private changeDetector:ChangeDetectorRef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
getThumbnailUrl(item:IListItem):string {
|
getThumbnailUrl(item:IListItem):string {
|
||||||
@ -53,6 +53,9 @@ import { AppConfig } from "../../shared/app.config";
|
|||||||
}
|
}
|
||||||
|
|
||||||
onChanged() {
|
onChanged() {
|
||||||
console.log("changed");
|
if(this.item) {
|
||||||
|
this.item.updated = new Date(new Date().getTime()).toISOString();
|
||||||
|
this.changeDetector.detectChanges();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user