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

32 lines
1.1 KiB

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.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.onclick = () => {changesort();};
sb.setAttribute('id', 'sort-button');
hb.appendChild(sb);
let ob = document.createElement('p');
ob.innerHTML = 'Ascending';
ob.className = 'header-button';
ob.onclick = () => {changeascend();};
ob.setAttribute('id', 'order-button');
hb.appendChild(ob);
}