How to use the gui/menu.blur function in gui

To help you get started, we’ve selected a few gui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github os-js / OS.js / src / client / javascript / core / window-manager.js View on Github external
// We should hide the menu if the clicked entry does not match up with
    // the following conditions
    if ( hitMenu ) {
      if ( hitMenu.tagName === 'GUI-MENU-ENTRY'  ) {
        if ( hitMenu.getAttribute('data-disabled') !== 'true' ) {
          if ( !DOM.$hasClass(hitMenu, 'gui-menu-expand') ) {
            hitMenu = null;
          }
        }
      } else if ( hitMenu.tagName === 'GUI-MENU-BAR'  ) {
        hitMenu = null;
      }
    }

    if ( !hitMenu ) {
      Menu.blur();
    }

    // Blur menu if we click body
    if ( ev.target.tagName === 'BODY' ) {
      const win = this.getCurrentWindow();
      if ( win ) {
        win._blur();
      }
    }

    Theme.themeAction('event', [ev]);
  }
github os-js / OS.js / src / client / javascript / core / init.js View on Github external
error: error,
          exception: exception,
          bugreport: bugreport
        });

        return true;
      } catch ( e ) {
        console.warn('An error occured while creating Error Dialog', e);
        console.warn('stack', e.stack);
      }
    }

    return false;
  }

  Menu.blur();

  if ( (exception instanceof Error) && (exception.message.match(/^Script Error/i) && String(exception.lineNumber).match(/^0/)) ) {
    console.error('VENDOR ERROR', {
      title: title,
      message: message,
      error: error,
      exception: exception
    });
    return;
  } else {
    console.error(title, message, error, exception);
  }

  const testMode = OSJS_DEBUG && window.location.hash.match(/mocha=true/);
  if ( !testMode ) {
    if ( !_dialog() ) {
github os-js / OS.js / src / client / javascript / core / init.js View on Github external
if ( hasShutDown || !hasBooted ) {
    return;
  }

  hasShutDown = true;
  hasBooted = false;

  window.removeEventListener('message', onMessage, false);

  const wm = WindowManager.instance;
  if ( wm ) {
    wm.toggleFullscreen();
  }

  Preloader.clear();
  Menu.blur();
  Process.killAll();
  SearchEngine.destroy();
  PackageManager.destroy();
  Authenticator.instance.destroy();
  Storage.instance.destroy();
  Connection.instance.destroy();

  triggerHook('shutdown');

  console.warn('OS.js was shut down!');

  if ( !restart && getConfig('ReloadOnShutdown') === true ) {
    window.location.reload();
  }
}
github os-js / OS.js / src / client / javascript / core / window-manager.js View on Github external
_onContextMenu(ev) {
    this.onContextMenu(ev);

    if ( DOM.$isFormElement(ev) ) {
      Menu.blur();
    } else {
      ev.preventDefault();
      return false;
    }

    return true;
  }