mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improvedUiTasks
This commit is contained in:
@@ -4,6 +4,8 @@ import { ImageCroppedEvent } from 'ngx-image-cropper';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||
import { Share } from '@capacitor/share';
|
||||
import { Router } from '@angular/router';
|
||||
import { Directory, Filesystem } from '@capacitor/filesystem';
|
||||
|
||||
@Component({
|
||||
selector: 'app-preview-camera',
|
||||
@@ -14,6 +16,7 @@ export class PreviewCameraPage implements OnInit {
|
||||
|
||||
constructor( private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
public router: Router,
|
||||
private publicService: PublicationsService) { }
|
||||
|
||||
|
||||
@@ -94,16 +97,24 @@ async getIconGallery(){
|
||||
|
||||
}
|
||||
deleteImage(){
|
||||
window.onload = function(){
|
||||
const delmage = document.getElementById("img")
|
||||
delmage.onclick = function(){
|
||||
return window.localStorage.removeItem("img")
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', ()=>{
|
||||
document.querySelector('img').addEventListener('click',removeImage)
|
||||
})
|
||||
function removeImage(ev){
|
||||
console.log(ev.target, ev.currentTarget)
|
||||
let img = ev.currentTarget
|
||||
let src = ev.target.closest('.img')
|
||||
src?.parentElement.removeChild(src)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
async getIconShare(){
|
||||
|
||||
|
||||
await Share.share({
|
||||
title: 'See cool stuff',
|
||||
text: 'Really awesome thing you need to see right meow',
|
||||
@@ -113,8 +124,25 @@ async getIconShare(){
|
||||
|
||||
}
|
||||
|
||||
redirPage(){
|
||||
this.router.navigateByUrl('/chat')
|
||||
}
|
||||
|
||||
|
||||
|
||||
async deleteFile(entry){
|
||||
if(entry.isFile){
|
||||
await Filesystem.deleteFile({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name
|
||||
})
|
||||
}else{
|
||||
await Filesystem.rmdir({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name,
|
||||
recursive:true //remove all file as well
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user