-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsavingModal.js
More file actions
45 lines (34 loc) · 917 Bytes
/
savingModal.js
File metadata and controls
45 lines (34 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"use strict"
var length = ""
const {remote, ipcRenderer} = require('electron')
ipcRenderer.on('new', function (event, data) {
setProgress(data)
length = data + 1
})
ipcRenderer.on('update', function (event, data) {
console.log(data)
updateProgress(data)
})
ipcRenderer.on('done', function (event, data) {
console.log(done)
done()
})
function setProgress () {
$('#p').css({'background-color':'#84ACCE','height':'20px','width':'5%'})
}
function updateProgress (value) {
var width = value * 100 / length
$('#p').velocity({width:width + "%"},300)
}
function done () {
$('#p').velocity({width:'100%'},300)
$('<p>').text('Complete').appendTo('#p')
$('#close').removeClass('hide')
$('#dashboard').removeClass('hide')
}
$('#close').on('click', function () {
ipcRenderer.send('closeSavingModal','close')
})
$('#dashboard').on('click', function () {
ipcRenderer.send('closeSavingModal','dashboard')
})