Skip to content

Commit

Permalink
[gchq#181] add breakpoint check in HTMLOperation so desktop doesn't g…
Browse files Browse the repository at this point in the history
…et op description errors
  • Loading branch information
valdelaseras committed May 10, 2023
1 parent d774a50 commit 997f26e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/web/App.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ class App {
*/
updateVisibility( elm, isVisible ){
isVisible ? elm.classList.remove("hidden") : elm.classList.add("hidden");
}
}h

/**
* Set desktop UI ( on init and on window resize events )
Expand Down Expand Up @@ -901,7 +901,7 @@ class App {
* Be mindful to update these fixed numbers accordingly in the stylesheets
* ( themes/_structure ) if you make changes to those elements' height.
*/
assignAvailableHeight( isMobile ){
assignAvailableHeight(){
const bannerHeight = 40;
const controlsHeight = 50;
const operationsHeight = 80;
Expand Down
4 changes: 3 additions & 1 deletion src/web/HTMLOperation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ class HTMLOperation {
const favourites = JSON.parse(localStorage.favourites);
const isFavourite = favourites.includes(this.name);

html += `<i title="${this.name}" class='material-icons icon-add-favourite mobile-only star-icon op-icon ${isFavourite ? "fav-op" : ""}'>
if ( window.innerWidth < this.app.breakpoint ){
html += `<i title="${this.name}" class='material-icons icon-add-favourite star-icon op-icon ${isFavourite ? "fav-op" : ""}'>
${isFavourite ? "star" : "star_outline"}
</i>`
}

html += "</li>";

Expand Down

0 comments on commit 997f26e

Please sign in to comment.