This repository has been archived on 2019-03-08. You can view files and clone it, but cannot push or open issues or pull requests.
MillionHopes/preferences.js

30 lines
956 B
JavaScript
Raw Permalink Normal View History

2017-07-03 16:56:29 +00:00
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')
})
}