From ae2319bbf3caed2ea71559c2cfbd34f2812fca88 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 29 Jul 2021 15:27:12 +0100 Subject: [PATCH] save --- src/app/pages/agenda/agenda.page.ts | 212 +++++++++--------- src/app/pages/events/events.page.ts | 1 - .../event-list/event-list.page.html | 131 ++++++----- .../event-list/event-list.page.scss | 12 +- .../event-list/event-list.page.ts | 11 +- 5 files changed, 193 insertions(+), 174 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index c7b7f7af9..6eb67fbae 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -41,7 +41,7 @@ import { CalendarService } from 'src/app/store/calendar.service'; ], }) export class AgendaPage implements OnInit { - + view: CalendarView = CalendarView.Day; viewDate: Date = new Date(); @@ -73,16 +73,16 @@ export class AgendaPage implements OnInit { showTimelinePR = false; showTimelineMD = false; - + // timeline filter timelineFilterState: string = 'Todos'; showTimelineFilterState: boolean; showTimeline=true; - + /* List of events of our calendar */ eventSource : eventSource[] = [] - + /* The title of the calendar */ viewTitle: string; @@ -108,12 +108,12 @@ export class AgendaPage implements OnInit { taskParticipants: any = []; taskParticipantsCc: any = []; adding: "intervenient" | "CC" = "intervenient"; - + @ViewChild(CalendarComponent) myCal: CalendarComponent; segment: "Combinado" | "Pessoal" | "Oficial" = "Combinado"; timelineSedment : "Combinado" | "Pessoal" | "Oficial"; - + profile:'mdgpr' | 'pr'; // this will make toggle add event and. @@ -153,7 +153,7 @@ export class AgendaPage implements OnInit { IsEvent: "edit" | "add" | "view"; viewingEventObject: CalendarEvent ; loggeduser: User; - + constructor( private alertCtrl: AlertController, @Inject(LOCALE_ID) private locale: string, @@ -194,7 +194,7 @@ export class AgendaPage implements OnInit { this.updateEventListBox() }, 1000) - + } ngOnInit() { @@ -215,7 +215,7 @@ export class AgendaPage implements OnInit { if ( realoadCounter != 0) { this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); - + } realoadCounter++; } @@ -258,7 +258,7 @@ export class AgendaPage implements OnInit { this.clearPostEvent(); this.IsEvent= "view"; - + this.viewingEventObject = event; this.eventSelectedDate = event.start; @@ -266,7 +266,7 @@ export class AgendaPage implements OnInit { this.cloneAllmobileComponent(); - + this.showEventEditOrOpen = 'edit'; if( window.innerWidth <= 1024) { @@ -289,7 +289,7 @@ export class AgendaPage implements OnInit { onCurrentChanged = (ev: Date) => { // timeline change date - this.timelineDate = momentG(new Date(ev),'dd MMMM yyyy'); + this.timelineDate = momentG(new Date(ev),'dd MMMM yyyy'); this.viewDate = new Date(ev); // calendar change date this.eventSelectedDate = new Date(ev); @@ -313,7 +313,7 @@ export class AgendaPage implements OnInit { this.rangeEndDate = ev.endTime; this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); - + try { this.myCal.update(); @@ -326,19 +326,19 @@ export class AgendaPage implements OnInit { // for calendar currentDayEventDisplayBorder(day: any, id: any) { - + const events = day[id].events; if (events.length == 0) { - + return ""; } else if (events.length >= 1) { - + let classs = []; events.forEach(element => { - + const profile_ = element.profile == 'md'? 'mdgpr': 'pr'; const eventtype = element.event.CalendarName; @@ -347,11 +347,11 @@ export class AgendaPage implements OnInit { // // console.log(id, (endMinutes + endHours)) // classs.push(`calendar-event-border`); // } - + classs.push(`calendar-event-border calendar-${profile_}-event-type-${eventtype}`); }); - + return classs.join(' '); } @@ -389,7 +389,7 @@ export class AgendaPage implements OnInit { this.showTimelineFilterState = false; eventsList.forEach((element, eventIndex) => { - + // timeline start const startHours = new Date(element.StartDate).getHours().toLocaleString(); const EndHours = new Date(element.EndDate).getHours().toLocaleString(); @@ -413,7 +413,7 @@ export class AgendaPage implements OnInit { return events; } - + eventFilter() {} TimelineDayEvent(day): string { @@ -421,7 +421,7 @@ export class AgendaPage implements OnInit { } get calendarDay(): string { - + return ((new Date(this.timelineDate)).getDate()).toString().padStart(2,'0') } @@ -431,7 +431,7 @@ export class AgendaPage implements OnInit { const endTimeSamp = new Date(endTime).toLocaleDateString() const endMinutes = new Date(endTime).getMinutes() - const endHours = new Date(endTime).getHours() + const endHours = new Date(endTime).getHours() if (startTimeSamp < endTimeSamp && (endMinutes + endHours) == 0) { @@ -449,7 +449,7 @@ export class AgendaPage implements OnInit { this.showLoader = true; if(window.innerWidth < 800){ - + // this.showTimeline = false; switch (this.segment) { @@ -458,27 +458,29 @@ export class AgendaPage implements OnInit { if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) { this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then( - + (response:any) => { + console.log(response); + // calendar this.calendarService.removeRange(startTime, endTime, 'md') // loop this.calendarService.pushEvent(response, 'md'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date') - + this.myCal.update(); this.myCal.loadEvents(); - + this.showLoader = false; this.showTimeline = true; - + }).finally(()=>{ this.showLoader = false; }) - + } else if(this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') { @@ -487,7 +489,7 @@ export class AgendaPage implements OnInit { this.calendarService.removeRange(startTime, endTime, 'pr') // calendar this.calendarService.pushEvent(response, 'pr'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') this.myCal.update(); @@ -495,31 +497,31 @@ export class AgendaPage implements OnInit { this.showLoader = false; this.showTimeline = true; - + }).finally(()=>{ this.showLoader = false; - }) + }) } else if(this.loggeduser.Profile == 'PR') { this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then( (response:any) => { - + // calendar // this.eventSource=[]; // clear the current month only this.calendarService.removeRange(startTime, endTime, 'pr') - + this.calendarService.pushEvent(response, 'pr'); - - + + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') - + this.myCal.update(); this.myCal.loadEvents(); - + this.showLoader = false; this.showTimeline = true; @@ -529,21 +531,21 @@ export class AgendaPage implements OnInit { }) } break; - + case "Pessoal": //Inicializa o array eventSource if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { - + this.calendarService.removeRange(startTime, endTime, 'md') const eventsList = response.filter(data => data.CalendarName == "Pessoal"); // loop this.calendarService.pushEvent(eventsList, 'md'); - - + + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date') - + this.myCal.update(); this.myCal.loadEvents(); @@ -552,22 +554,22 @@ export class AgendaPage implements OnInit { }).finally(()=>{ this.showLoader = false; }) - + } else{ this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { //this.eventSource=[]; - + // clear the current month only this.calendarService.removeRange(startTime, endTime, 'pr') const eventsList = response.filter(data => data.CalendarName == "Pessoal"); this.calendarService.pushEvent(eventsList, 'pr'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') - - + + this.myCal.update(); this.myCal.loadEvents(); @@ -579,7 +581,7 @@ export class AgendaPage implements OnInit { }) } break; - + case "Oficial": //Inicializa o array eventSource @@ -587,37 +589,37 @@ export class AgendaPage implements OnInit { if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => { - + this.calendarService.removeRange(startTime, endTime, 'md') const eventsList = res.filter(data => data.CalendarName == "Oficial"); - + this.calendarService.pushEvent(eventsList, 'md'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date') this.myCal.update(); this.myCal.loadEvents(); - + this.showLoader = false; this.showTimeline = true; - + }).finally(()=>{ this.showLoader = false; }) } else { this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => { - - // this.eventSource=[]; + + // this.eventSource=[]; this.calendarService.removeRange(startTime, endTime, 'pr') const eventsList = res.filter(data => data.CalendarName == "Oficial"); this.calendarService.pushEvent(eventsList, 'pr'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') this.myCal.update(); @@ -631,24 +633,24 @@ export class AgendaPage implements OnInit { }) } break; - - } + + } } else { // calendar let counter = 0; - + if(this.loggeduser.Profile == 'MDGPR') { - + this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then( (response:any) => { - + let eventsList = response; this.calendarService.removeRange(startTime, endTime, 'md') // loop this.calendarService.pushEvent(eventsList, 'md'); - + this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date') this.myCal.update(); @@ -660,7 +662,7 @@ export class AgendaPage implements OnInit { if(counter==2) { this.showLoader = false; } - + }).finally(()=> { counter++; @@ -670,21 +672,21 @@ export class AgendaPage implements OnInit { }) this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { - + let eventsList = response; - + // clear the current month only this.calendarService.removeRange(startTime, endTime, 'pr') this.calendarService.pushEvent(eventsList, 'pr'); this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') - + this.myCal.update(); this.myCal.loadEvents(); this.showTimelinePR = true; - + counter++; if(counter==2 || this.loggeduser.Profile == 'PR') { @@ -701,7 +703,7 @@ export class AgendaPage implements OnInit { } else { this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { - + let eventsList; if(this.segment == 'Oficial') { eventsList = response.filter(data => data.CalendarName == "Oficial"); @@ -710,20 +712,20 @@ export class AgendaPage implements OnInit { } else { eventsList = response; } - + // clear the current month only this.calendarService.removeRange(startTime, endTime, 'pr') this.calendarService.pushEvent(eventsList, 'pr'); this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date') - + this.myCal.update(); this.myCal.loadEvents(); this.showTimelinePR = true; - + counter++; if(counter==1 || this.loggeduser.Profile == 'PR') { @@ -737,7 +739,7 @@ export class AgendaPage implements OnInit { }) } - + } } @@ -756,34 +758,34 @@ export class AgendaPage implements OnInit { var startDate: any = new Date(event.start); var endDate: any = this.EventTretment({ - startTime: startDate, + startTime: startDate, endTime: event.end }) - + const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0') - + event.manyDays = false event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString() - + if(!days.hasOwnProperty(day)) { days[day] = [] } if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) { - + // difference const diffTime = Math.abs(endDate - startDate); - const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); if (diffDays <= 150 && !event.event.IsAllDayEvent ) { if (diffDays >= 1) { - + const StartEvent = Object.assign({}, { title: event.title, start: event.start, @@ -805,28 +807,28 @@ export class AgendaPage implements OnInit { endMany: false, middle: false }) - + days[day].push(StartEvent) - + let i = 1; - - while (startDate.getFullYear() != endDate.getFullYear() || + + while (startDate.getFullYear() != endDate.getFullYear() || startDate.getMonth() != endDate.getMonth() || startDate.getDate() != endDate.getDate()) { const newDate = startDate.setDate(startDate.getDate()+ i) let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0') - + event.other = true - + event.start = newDate if(!days.hasOwnProperty(otherDays)) { days[otherDays] = [] } - - if (!(startDate.getFullYear() != endDate.getFullYear() || + + if (!(startDate.getFullYear() != endDate.getFullYear() || startDate.getMonth() != endDate.getMonth() || startDate.getDate() != endDate.getDate())) { // last push @@ -881,7 +883,7 @@ export class AgendaPage implements OnInit { }) days[otherDays].push(EndEvent) } - + } } else { @@ -893,7 +895,7 @@ export class AgendaPage implements OnInit { } - } + } days[day].push(event) @@ -908,7 +910,7 @@ export class AgendaPage implements OnInit { } }) }, 10) - + return days } @@ -955,7 +957,7 @@ export class AgendaPage implements OnInit { } async openAddEvent() { - + await this.cloneAllmobileComponent(); this.showEventEditOrOpen = 'add'; @@ -975,7 +977,7 @@ export class AgendaPage implements OnInit { await modal.present(); modal.onDidDismiss().then((data) => { if(data){ - + } this.openAddEventDismiss(data['data']) }); @@ -1015,7 +1017,7 @@ export class AgendaPage implements OnInit { this.router.navigate(['/home/agenda', eventId, 'agenda']); /* console.log(this.profile); - + const modal = await this.modalCtrl.create({ component: ViewEventPage, componentProps:{ @@ -1035,11 +1037,11 @@ export class AgendaPage implements OnInit { // open component async viewEventDetailDismiss(data) { - + await this.cloneAllmobileComponent() if (data.type == 'edit') { - + this.selectedEvent = data.event; this.postEvent = data.event; @@ -1079,7 +1081,7 @@ export class AgendaPage implements OnInit { approveEventDismiss({saveData, serialNumber, action}) { window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {} - + if(action == 'Aprovar') { this.eventToaprove = { back: true, @@ -1111,7 +1113,7 @@ export class AgendaPage implements OnInit { } } - + closeEventToApproveGoBack() { if( window.innerWidth <= 801){ this.router.navigate(['/home/agenda/event-list']); @@ -1154,7 +1156,7 @@ export class AgendaPage implements OnInit { async openAttendeesComponent(data) { this.adding = data.type - + this.cloneAllmobileComponent(); this.mobileComponent.showAttendees = true; } @@ -1174,7 +1176,7 @@ export class AgendaPage implements OnInit { async GoBackEditOrAdd() { - + if(this.showEventEditOrOpen == "edit") { this.cloneAllmobileComponent(); @@ -1210,7 +1212,7 @@ export class AgendaPage implements OnInit { this.taskParticipants = removeDuplicate(data) } - + async setIntervenientCC(data) { this.taskParticipantsCc = removeDuplicate(data) } @@ -1255,11 +1257,11 @@ export class AgendaPage implements OnInit { } }) }, 100) - + } async showEventBox(event) { - + if ( event.event.CalendarName == this.segment || this.segment == 'Combinado') { return true } @@ -1279,4 +1281,4 @@ export class AgendaPage implements OnInit { return reuslt.length != 0 } -} \ No newline at end of file +} diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index b6465ec06..072a06dbd 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -295,7 +295,6 @@ export class EventsPage implements OnInit { case 'MDGPR': this.processes.GetTasksList("Expediente", false).subscribe(result => { console.log(result); - this.expedienteStorage.reset(result) }); break; diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.html b/src/app/pages/gabinete-digital/event-list/event-list.page.html index 50c8b55be..ade35c9ba 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.html +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.html @@ -1,77 +1,84 @@ + + +
+
+ +
+
+ +
+ + + + Meu calendário + + + Presidente da República + + + + +
+
+ - - + + -
-
-
-
- -
-
- -
- - - - Meu calendário - - - Presidente da República - - - - -
+
- -
+
+
+ +
+ + + +
+
+

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

+

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

+
+
+

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

+

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}

+

{{event.workflowInstanceDataFields.Subject}}

+
+
+
+
+
+
+ + +
- -
-
-

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

-

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

+ *ngFor="let event of eventaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)"> +
+
+

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

+

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

+
+
+

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

+

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}

+

{{event.workflowInstanceDataFields.Subject}}

+
-
-

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

-

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}

-

{{event.workflowInstanceDataFields.Subject}}

-
-
- + -
- - -
- - -
-
-

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

-

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

-
-
-

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

-

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}

-

{{event.workflowInstanceDataFields.Subject}}

-
-
-
-
-
-
+
+
+
diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.scss b/src/app/pages/gabinete-digital/event-list/event-list.page.scss index 4cf050d1f..00df541f2 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.scss +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.scss @@ -1,11 +1,17 @@ @import '~src/function.scss'; +.header-2 { + border-top-right-radius: 24px; + border-top-left-radius: 24px; +} +.header-2{ + padding: 30px 20px 0 20px !important; + background-color: white; +} .main-content{ background-color: #fff !important; - border-top-left-radius: 25px; - border-top-right-radius: 25px; } .content{ - padding: 30px 20px 0 20px !important; + padding: 0px 20px 0 20px !important; /* margin: 0 auto; */ float: left; overflow: auto; diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index def667ae3..6fa4760af 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -45,7 +45,7 @@ export class EventListPage implements OnInit { this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith(pathname)) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { - this.doRefresh() + this.refreshing() } else { this.LoadToApproveEvents() } @@ -76,12 +76,16 @@ export class EventListPage implements OnInit { let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise(); this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal); this.eventaprovacaostore.resetmd(this.eventsMDGPRList); + console.log(this.eventsMDGPRList); + } else if(this.segment == 'PR'){ let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise(); let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise(); this.eventsPRList = prEventsOficial.concat(prEventsPessoal); this.eventaprovacaostore.resetpr(this.eventsPRList); + console.log(this.eventsMDGPRList); + } this.showLoader = false; this.skeletonLoader = false @@ -124,10 +128,11 @@ export class EventListPage implements OnInit { }, 1000); } - doRefresh() { - + doRefresh(event) { + setTimeout(() => { this.LoadToApproveEvents(); + event.target.complete(); }, 1000); }