Add todo to old scrollbar
This commit is contained in:
parent
8cb9b62b9d
commit
dc7bf44576
@ -1,3 +1,4 @@
|
|||||||
|
//TODO Delete this file
|
||||||
;(function(root, factory) {
|
;(function(root, factory) {
|
||||||
if (typeof exports === 'object') {
|
if (typeof exports === 'object') {
|
||||||
module.exports = factory(window, document)
|
module.exports = factory(window, document)
|
||||||
|
@ -3,6 +3,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
wde = new WebDesktopEnvironment
|
wde = new WebDesktopEnvironment
|
||||||
if (!WebDesktopEnvironment.isMobile){
|
if (!WebDesktopEnvironment.isMobile){
|
||||||
WebDesktopEnvironment.Open("finder", ["kek"])
|
WebDesktopEnvironment.Open("finder", ["kek"])
|
||||||
|
WebDesktopEnvironment.Open("personal-properties", ["kek"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -13,7 +14,6 @@ class WebDesktopEnvironment{
|
|||||||
static Applications = {};
|
static Applications = {};
|
||||||
static isMobile = false
|
static isMobile = false
|
||||||
constructor(){
|
constructor(){
|
||||||
this.wc = new WindowsCompositor
|
|
||||||
WebDesktopEnvironment.isMobile = WebDesktopEnvironment.CheckMobile()
|
WebDesktopEnvironment.isMobile = WebDesktopEnvironment.CheckMobile()
|
||||||
|
|
||||||
let applications = document.createElement("div")
|
let applications = document.createElement("div")
|
||||||
@ -46,8 +46,6 @@ class WebDesktopEnvironment{
|
|||||||
WebDesktopEnvironment.Open("personal-properties", [])
|
WebDesktopEnvironment.Open("personal-properties", [])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}).then(()=>{
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
WebDesktopEnvironment.Alert(error);
|
WebDesktopEnvironment.Alert(error);
|
||||||
@ -60,6 +58,7 @@ class WebDesktopEnvironment{
|
|||||||
windowsLayer.setAttribute('id', 'windows-layer')
|
windowsLayer.setAttribute('id', 'windows-layer')
|
||||||
document.body.appendChild(windowsLayer)
|
document.body.appendChild(windowsLayer)
|
||||||
}
|
}
|
||||||
|
this.wc = new WindowsCompositor
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -202,12 +201,15 @@ var getJSON = function(url, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class WindowsCompositor{
|
class WindowsCompositor{
|
||||||
|
windowLayer = undefined
|
||||||
movingElement = null
|
movingElement = null
|
||||||
|
|
||||||
constructor(){
|
constructor(){
|
||||||
console.log("Windows Compositor is online :)");
|
this.windowLayer = document.body.querySelector('#windows-layer')
|
||||||
addEventListener("mousedown", (event) => {
|
addEventListener("mousedown", (event) => {
|
||||||
|
this.bringWindowToFront(event.target.closest('.StandartApplicationWindow'))
|
||||||
this.catchClick(event)
|
this.catchClick(event)
|
||||||
|
|
||||||
})
|
})
|
||||||
addEventListener("mouseup", (event) => {
|
addEventListener("mouseup", (event) => {
|
||||||
this.movingElement = null
|
this.movingElement = null
|
||||||
@ -221,11 +223,18 @@ class WindowsCompositor{
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {HTMLElement} window
|
||||||
|
*/
|
||||||
|
bringWindowToFront(window){
|
||||||
|
console.log("kek")
|
||||||
|
this.windowLayer.insertBefore(this.windowLayer.lastChild, window)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {MouseEvent} event
|
* @param {MouseEvent} event
|
||||||
*/
|
*/
|
||||||
catchClick(event){
|
catchClick(event){
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case event.target.className == "WindowFrameTopBar":
|
case event.target.className == "WindowFrameTopBar":
|
||||||
this.movingElement = event.target.parentElement
|
this.movingElement = event.target.parentElement
|
||||||
|
Loading…
Reference in New Issue
Block a user