An electron-based WIP aesthetic file explorer ^^
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FileKade/scripts/startup/setbuttons.js

35 lines
1.2 KiB

3 years ago
const path = require('path');
const refresh = require("../fileview/refresh");
const changesort = require('../buttons/changesort');
const changeascend = require('../buttons/changeascend');
module.exports = () => {
let hb = document.getElementById('header-buttons');
let backb = document.createElement('p');
backb.innerHTML = 'Go Back';
backb.setAttribute('id', 'back-button');
backb.className = 'header-button';
backb.classList.add('nosel');
3 years ago
backb.onclick = () => {
if (window.kade.cpath !== 'C:\\' && window.kade.cpath !== '\\') {refresh(path.join(window.kade.cpath, '..'));}
};
hb.appendChild(backb);
let sb = document.createElement('p');
sb.innerHTML = 'Sort by: Name';
sb.className = 'header-button';
sb.classList.add("nosel");
3 years ago
sb.onclick = () => {changesort();};
sb.setAttribute('id', 'sort-button');
hb.appendChild(sb);
let ob = document.createElement('p');
ob.innerHTML = 'Ascending';
ob.className = 'header-button';
ob.classList.add("nosel");
3 years ago
ob.onclick = () => {changeascend();};
ob.setAttribute('id', 'order-button');
hb.appendChild(ob);
}