This commit is contained in:
Gerome Matilla 2020-06-09 18:13:12 +08:00
parent dbac35e1e9
commit ff65622eb7
11 changed files with 36 additions and 19 deletions

View File

@ -1,4 +1,5 @@
class AutoSuggestion {
constructor() {
this._searchBox = document.querySelector('#searchBox');
this._suggestionsUL = document.querySelector('#suggestions');

View File

@ -1,4 +1,5 @@
class CenteredBox {
constructor() {
this._centeredBox = document.querySelector('#centeredBox');

View File

@ -13,10 +13,15 @@ class Dashboard {
this._searchBoxContainer = document.querySelector('#searchBoxContainer');
this._weatherScreen = document.querySelector('#weatherScreen');
this._registerOverlayMouseUpEvent();
this._init();
}
_disableDashboardInputs = (status) => {
_init = () => {
this._registerOverlayMouseUpEvent();
this._disableDashboardInputs(true);
}
_disableDashboardInputs = status => {
const elems = this._dashboard.getElementsByTagName('input');
const len = elems.length;

View File

@ -62,6 +62,7 @@ class DockButtons {
const aDock = document.createElement('a');
aDock.className = 'dockLink';
aDock.href = url;
aDock.tabIndex = '-1';
// Create div container
const dockButton = this._buildDockButton(

View File

@ -1,5 +1,5 @@
class GreeterDateMessage {
constructor() {
this._greeterMessage = document.querySelector('#greeterMessage');
this._dateMessage = document.querySelector('#dateMessage');

View File

@ -9,6 +9,10 @@ class KeyBinding {
this._documentAddKeyDownEvent = this._documentAddKeyDownEvent.bind(this);
this._documentAddKeyUpEvent = this._documentAddKeyUpEvent.bind(this);
this._init();
}
_init = () => {
this._registerDocumentAddKeyDownEvent();
this._registerDocumentAddKeyUpEvent();
}

View File

@ -1,4 +1,5 @@
class SwipeEventCallbacks extends SwipeEventManager {
constructor() {
super();
this.swipeEvent = this.swipeEvent;

View File

@ -15,6 +15,10 @@ class ProfileImage {
this.getProfileAnimationStatus = this.getProfileAnimationStatus.bind(this);
this._init();
}
_init = () => {
this._registerAnimationEndEvent();
this._registerOnClickEvent();
}

View File

@ -1,4 +1,5 @@
class SearchBoxShow {
constructor() {
this._searchBox = document.querySelector('#searchBox');
@ -10,7 +11,6 @@ class SearchBoxShow {
this.showSearchBox = this.showSearchBox.bind(this);
this.hideSearchBox = this.hideSearchBox.bind(this);
this.toggleSearchBox = this.toggleSearchBox.bind(this);
}
getSearchBoxVisibility = () => {

View File

@ -1,4 +1,5 @@
class ThemeEngine {
constructor() {
this._localStorage = window.localStorage;

View File

@ -15,17 +15,28 @@ class WebMenu {
this._webItemFocus;
this._webListIndex = 0;
this._fuzzySearch();
this._init();
}
_init = () => {
this._fuzzySearch();
this._populateWebMenu();
this._getFirstItem();
// Disable inputs
this._disableWebMenuInputs(true);
this._registerWebMenuSearchBoxKeyDownEvent();
this._registerWebMenuKeyDownEvent();
}
// Return web menu status
getwebMenuVisibility = () => {
return this._webMenuVisibility;
}
// Disable textboxes
_disableWebMenuInputs = (status) => {
_disableWebMenuInputs = status => {
const elems = this._webMenu.getElementsByTagName('input');
const len = elems.length;
@ -310,7 +321,7 @@ class WebMenu {
const menuItemWidth = 138;
const scrollBarWidth = 10;
// viewport width
const vw = (unit) => window.innerWidth * (unit / 100);
const vw = unit => window.innerWidth * (unit / 100);
// Gets the number of columns by dividing the screen width minus the padding, scroll width and
// average of menu item width by the menu item width
@ -420,16 +431,4 @@ class WebMenu {
_registerWebMenuSearchBoxKeyDownEvent = () => {
this._webMenuSearchBox.onkeydown = this._webMenuSearchBoxKeyDownEvent;
}
_init = () => {
this._populateWebMenu();
this._getFirstItem();
// Disable inputs
this._disableWebMenuInputs(true);
this._registerWebMenuSearchBoxKeyDownEvent();
this._registerWebMenuKeyDownEvent();
}
}