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 { class AutoSuggestion {
constructor() { constructor() {
this._searchBox = document.querySelector('#searchBox'); this._searchBox = document.querySelector('#searchBox');
this._suggestionsUL = document.querySelector('#suggestions'); this._suggestionsUL = document.querySelector('#suggestions');

View File

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

View File

@ -13,10 +13,15 @@ class Dashboard {
this._searchBoxContainer = document.querySelector('#searchBoxContainer'); this._searchBoxContainer = document.querySelector('#searchBoxContainer');
this._weatherScreen = document.querySelector('#weatherScreen'); 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 elems = this._dashboard.getElementsByTagName('input');
const len = elems.length; const len = elems.length;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,17 +15,28 @@ class WebMenu {
this._webItemFocus; this._webItemFocus;
this._webListIndex = 0; this._webListIndex = 0;
this._fuzzySearch();
this._init(); this._init();
} }
_init = () => {
this._fuzzySearch();
this._populateWebMenu();
this._getFirstItem();
// Disable inputs
this._disableWebMenuInputs(true);
this._registerWebMenuSearchBoxKeyDownEvent();
this._registerWebMenuKeyDownEvent();
}
// Return web menu status // Return web menu status
getwebMenuVisibility = () => { getwebMenuVisibility = () => {
return this._webMenuVisibility; return this._webMenuVisibility;
} }
// Disable textboxes // Disable textboxes
_disableWebMenuInputs = (status) => { _disableWebMenuInputs = status => {
const elems = this._webMenu.getElementsByTagName('input'); const elems = this._webMenu.getElementsByTagName('input');
const len = elems.length; const len = elems.length;
@ -310,7 +321,7 @@ class WebMenu {
const menuItemWidth = 138; const menuItemWidth = 138;
const scrollBarWidth = 10; const scrollBarWidth = 10;
// viewport width // 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 // 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 // average of menu item width by the menu item width
@ -420,16 +431,4 @@ class WebMenu {
_registerWebMenuSearchBoxKeyDownEvent = () => { _registerWebMenuSearchBoxKeyDownEvent = () => {
this._webMenuSearchBox.onkeydown = this._webMenuSearchBoxKeyDownEvent; this._webMenuSearchBox.onkeydown = this._webMenuSearchBoxKeyDownEvent;
} }
_init = () => {
this._populateWebMenu();
this._getFirstItem();
// Disable inputs
this._disableWebMenuInputs(true);
this._registerWebMenuSearchBoxKeyDownEvent();
this._registerWebMenuKeyDownEvent();
}
} }