30 lines
956 B
JavaScript
30 lines
956 B
JavaScript
const ipc = require('electron').ipcRenderer;
|
|
|
|
function logout_click(){
|
|
ipc.send('log-out');
|
|
}
|
|
|
|
function genericpane_click(evt,prefname){
|
|
var i, tabcontent, tablinks;
|
|
tabcontent = document.getElementsByClassName("mh-prefs");
|
|
for (i = 0; i < tabcontent.length; i++) {
|
|
tabcontent[i].style.display = "none";
|
|
}
|
|
|
|
// Get all elements with class="tablinks" and remove the class "active"
|
|
tablinks = document.getElementsByClassName("nav-group-item");
|
|
for (i = 0; i < tablinks.length; i++) {
|
|
tablinks[i].classList.remove("active");
|
|
}
|
|
|
|
// Show the current tab, and add an "active" class to the button that opened the tab
|
|
document.getElementById(prefname).style.display = "block";
|
|
document.getElementById(prefname.replace("pref","pane")).classList.add("active");
|
|
|
|
const asyncMsgBtn = document.getElementById('mh-account-logout');
|
|
asyncMsgBtn.addEventListener('click', function () {
|
|
ipc.send('log-out')
|
|
})
|
|
|
|
}
|