Socialify

Folder ..

Viewing renderer.ts
28 lines (24 loc) • 1.1 KB

 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
import systemLevelInformation from './systemLevelInformation';
import Preferences from './Preferences';

// List all the favourites

Preferences.getFavourites().forEach(favourite => {
    const favourites = document.getElementById('favourites');
    const listElement = document.createElement('li');
    const iconElement = document.createElement('i');
    iconElement.classList.add(favourite.icon);
    listElement.appendChild(iconElement);
    const spanElement = document.createElement('span');
    spanElement.innerHTML = favourite.text;
    listElement.appendChild(spanElement);
    listElement.setAttribute('path', favourite.path);
    if (Preferences.getConfiguredPathToDisplayAfterAppInit() === favourite.path) {
        listElement.classList.add('selected');
        displayDirectoryViaElement(listElement);
    }
    favourites.appendChild(listElement);
});

function displayDirectoryViaElement(element: HTMLElement) {
    // Listing Files in the Directory
    const currentFolders: any = systemLevelInformation.getAllFilesOfDirectory(element.getAttribute('path'));
    console.log(currentFolders);
}