mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 08:41:32 -04:00
[#181] update opListCreate to desktopOpListCreate ( to always include drag events and popovers ) and the inverse for mobile. Now it is ready for window resizing
This commit is contained in:
parent
c6cc998100
commit
89c1ab12ab
4 changed files with 30 additions and 13 deletions
|
@ -185,14 +185,34 @@ class OperationsWaiter {
|
|||
*/
|
||||
opListCreate(e) {
|
||||
if ( window.innerWidth < this.app.breakpoint ){
|
||||
this.manager.recipe.createSortableSeedList(e.target, false);
|
||||
this.disableOpsListPopovers();
|
||||
this.mobileOpListCreate(e);
|
||||
} else {
|
||||
this.manager.recipe.createSortableSeedList(e.target);
|
||||
this.enableOpPopover(e.target);
|
||||
this.desktopOpListCreate(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the desktop op-list which allows popovers
|
||||
* and dragging
|
||||
*
|
||||
* @param {event} e
|
||||
*/
|
||||
desktopOpListCreate(e){
|
||||
this.manager.recipe.createSortableSeedList(e.target);
|
||||
this.enableOpPopover(e.target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the mobile op-list which does not allow
|
||||
* popovers and dragging
|
||||
*
|
||||
* @param {event} e
|
||||
*/
|
||||
mobileOpListCreate(e){
|
||||
this.manager.recipe.createSortableSeedList(e.target, false);
|
||||
this.disableOpsListPopovers();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enable the target operation popover itself to gain focus which
|
||||
|
|
|
@ -27,7 +27,7 @@ class WindowWaiter {
|
|||
* continuous resetting).
|
||||
*/
|
||||
windowResize() {
|
||||
// @TODO: maybe a debounce is desireable although genrally people won't be resizing like crazy
|
||||
// @TODO: maybe a debounce is desirable although generally people won't be resizing like crazy.. I think
|
||||
if ( window.innerWidth >= this.app.breakpoint ) {
|
||||
this.app.setDesktopUI(false);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue