This commit is contained in:
Gerome Matilla 2020-06-16 16:30:53 +08:00
parent 26dc3d27ec
commit 6c473f2434
8 changed files with 26 additions and 25 deletions

View File

@ -48,11 +48,11 @@ class AutoSuggestion {
e.preventDefault();
const phraseButtons = Array.prototype.slice.call(document.querySelectorAll('button'));
const phraseIndex = (phraseButtons.indexOf(document.activeElement) - 1) % phraseButtons.length;
let phraseIndex = (phraseButtons.indexOf(document.activeElement) - 1) % phraseButtons.length;
if (phraseIndex < 0) {
phraseIndex = phraseButtons.length - 1;
};
}
const phraseButton = phraseButtons[parseInt(phraseIndex, 10)];
phraseButton.focus();

View File

@ -61,7 +61,7 @@ class Dashboard {
toggleDashboard = () => {
console.log('toggle dashboard');
// console.log('toggle dashboard');
if (this._rightDashboardVisibility) {
@ -76,7 +76,7 @@ class Dashboard {
// If centered box is hidden, open it
if (this._centeredBox.classList.contains('hiddenBox')) {
console.log('centered box is hidden, reopening...');
// console.log('centered box is hidden, reopening...');
// Rotate profile container
profileImage.rotateProfile();
@ -88,16 +88,16 @@ class Dashboard {
// Check if any of these are open, if yes, close it
if (this._searchBoxContainer.classList.contains('showSearchBox')) {
console.log('searchbox is open, closing...');
// console.log('searchbox is open, closing...');
searchBoxShow.hideSearchBox();
} else if (this._webMenu.classList.contains('showWebMenu')) {
console.log('web menu is open, closing...');
// console.log('web menu is open, closing...');
webMenu.hideWebMenu();
return;
} else if (this._weatherScreen.classList.contains('showWeatherScreen')) {
console.log('weather screen is open, closing...');
// console.log('weather screen is open, closing...');
weatherScreen.hideWeatherScreen();
return;
@ -109,7 +109,7 @@ class Dashboard {
if (this._rightDashboardVisibility) {
this.toggleDashboard();
}
console.log('dashboard overlay clicked...');
// console.log('dashboard overlay clicked...');
}
_registerOverlayMouseUpEvent = () => {

View File

@ -81,7 +81,7 @@ class DockButtons {
aDock.appendChild(dockButton);
this._dock.appendChild(aDock);
};
}
}
_populateDock = () => {

View File

@ -94,7 +94,7 @@ class KeyBinding {
// Backspacing while there's no search query will hide searhbox
// Will also hide if you hit enter
if ((e.key === 'Backspace' || e.key === 'Enter') &&
this._searchBox.value < 1) { searchBoxShow.toggleSearchBox(); return; };
this._searchBox.value < 1) { searchBoxShow.toggleSearchBox(); return; }
}
}

View File

@ -61,7 +61,7 @@ class SearchBoxShow {
this.showSearchBox();
}
console.log('toggle searchbox');
// console.log('toggle searchbox');
}

View File

@ -243,7 +243,7 @@ class WeatherScreen {
toggleWeatherScreen = () => {
console.log('toggle weather screen');
// console.log('toggle weather screen');
// If profile anim is still running,
// Return to avoid spam
@ -263,16 +263,16 @@ class WeatherScreen {
// Check if any of these are open, if yes, close it
if (this._webMenu.classList.contains('showWebMenu')) {
console.log('web menu is open, closing...');
// console.log('web menu is open, closing...');
webMenu.hideWebMenu();
return;
} else if (this._searchBoxContainer.classList.contains('showSearchBox')) {
console.log('searchbox is open, closing...');
// console.log('searchbox is open, closing...');
searchBoxShow.hideSearchBox();
} else if (this._dashboard.classList.contains('showRightDashboard')) {
console.log('dashboard is open, closing...');
// console.log('dashboard is open, closing...');
dashboard.hideDashboard();
}

View File

@ -116,7 +116,7 @@ class WeatherSettings {
if ((this._origLongitude !== currentCoord.longitude) || (this._origLatitude !== currentCoord.latitude)) {
console.log('update current position');
// console.log('update current position');
// Update origPositions
this._origLongitude = currentCoord.longitude;
@ -131,9 +131,9 @@ class WeatherSettings {
// Error
_watchGeoError = err => {
console.warn('ERROR(' + err.code + '): ' + err.message);
// console.warn('ERROR(' + err.code + '): ' + err.message);
if (err.code == err.PERMISSION_DENIED) {
if (err.code === err.PERMISSION_DENIED) {
this._deniedGeolocation();
@ -150,7 +150,7 @@ class WeatherSettings {
navigator.permissions.query({name:'geolocation'}).then(result => {
if ((result.state === 'prompt') || (result.state == 'granted')) {
if ((result.state === 'prompt') || (result.state === 'granted')) {
this._watchGeoPosition();
@ -170,13 +170,13 @@ class WeatherSettings {
if (this._locatorMode === 'geolocation') {
console.log('geolocation');
// console.log('geolocation');
this._weatherSettingsCityIDGroup.classList.add('hideWeatherSettings');
} else if (this._locatorMode === 'city') {
console.log('city');
// console.log('city');
this._weatherSettingsCityIDGroup.classList.remove('hideWeatherSettings');

View File

@ -103,6 +103,7 @@ class WebMenu {
// Allow fuzzy searching in web menu
_fuzzySearch = () => {
// eslint-disable-next-line no-extend-native
String.prototype.fuzzy = function(term, ratio) {
const string = this.toLowerCase();
const compare = term.toLowerCase();
@ -229,7 +230,7 @@ class WebMenu {
// Toggle web menu screen
toggleWebMenu = () => {
console.log('toggle web menu');
// console.log('toggle web menu');
// If profile anim is still running,
// Return to avoid spam
@ -249,15 +250,15 @@ class WebMenu {
// Check if any of these are open, if yes, close it
if (searchBoxContainer.classList.contains('showSearchBox')) {
console.log('searchbox is open, closing...');
// console.log('searchbox is open, closing...');
searchBoxShow.hideSearchBox();
} else if (this._dashboard.classList.contains('showRightDashboard')) {
console.log('dashboard is open, closing...');
// console.log('dashboard is open, closing...');
dashboard.hideDashboard();
} else if (this._weatherScreen.classList.contains('showWeatherScreen')) {
console.log('weather screen is open, closing...');
// console.log('weather screen is open, closing...');
weatherScreen.hideWeatherScreen();
return;