mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 08:41:32 -04:00
add function to check for window width and use that throughout the app for more convenient future use
This commit is contained in:
parent
6a1514db30
commit
df781bec00
6 changed files with 11 additions and 8 deletions
|
@ -450,7 +450,7 @@ ${navigator.userAgent}
|
|||
if (maximise) {
|
||||
pane.style.height = `${window.innerHeight - 40}px`;
|
||||
} else {
|
||||
if (window.innerWidth < this.app.breakpoint) {
|
||||
if (this.app.isMobileView()) {
|
||||
this.app.assignAvailableHeight();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ class OperationsWaiter {
|
|||
* @param {event} e
|
||||
*/
|
||||
opListCreate(e) {
|
||||
if (window.innerWidth < this.app.breakpoint) {
|
||||
if (this.app.isMobileView()) {
|
||||
this.createMobileOpList(e);
|
||||
} else {
|
||||
this.createDesktopOpList(e);
|
||||
|
@ -313,7 +313,7 @@ class OperationsWaiter {
|
|||
this.removeIntent = false;
|
||||
}.bind(this));
|
||||
|
||||
if (window.innerWidth >= this.app.breakpoint) {
|
||||
if (!this.app.isMobileView()) {
|
||||
$("#edit-favourites-list [data-toggle=popover]").popover();
|
||||
}
|
||||
$("#favourites-modal").modal();
|
||||
|
|
|
@ -33,7 +33,7 @@ class RecipeWaiter {
|
|||
*/
|
||||
initialiseOperationDragNDrop() {
|
||||
const recList = document.getElementById("rec-list");
|
||||
const isMobileView = window.innerWidth < this.app.breakpoint;
|
||||
const isMobileView = this.app.isMobileView();
|
||||
|
||||
// Recipe list
|
||||
Sortable.create(recList, {
|
||||
|
|
|
@ -30,7 +30,7 @@ class WindowWaiter {
|
|||
* continuous resetting).
|
||||
*/
|
||||
windowResize() {
|
||||
if (window.innerWidth >= this.app.breakpoint) {
|
||||
if (!this.app.isMobileView()) {
|
||||
this.onResizeToDesktop();
|
||||
} else {
|
||||
this.onResizeToMobile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue