B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Handler for window close event. Prompts to save scratchpad if
   * there are unsaved changes.
   *
   * @param nsIDOMEvent aEvent
   */
Handler for window close event. Prompts to save scratchpad if
there are unsaved changes.


Handler for window close event . Prompts to save scratchpad if there are unsaved changes .
function SP_onClose(aEvent)
  {
    if (this._skipClosePrompt) {
      return;
    }
    this.promptSave(function(aShouldClose, aSaved, aStatus) {
      let shouldClose = aShouldClose;
      if (aSaved && !Components.isSuccessCode(aStatus)) {
        shouldClose = false;
      }
      if (shouldClose) {
        this._skipClosePrompt = true;
        window.close();
      }
    }.bind(this));
    aEvent.preventDefault();
  }
function SP_onClose ( aEvent ) { if ( this . _skipClosePrompt ) { return ; } this . promptSave ( function ( aShouldClose , aSaved , aStatus ) { let shouldClose = aShouldClose ; if ( aSaved && ! Components . isSuccessCode ( aStatus ) ) { shouldClose = false ; } if ( shouldClose ) { this . _skipClosePrompt = true ; window . close ( ) ; } } . bind ( this ) ) ; aEvent . preventDefault ( ) ; }
Handler for window close event.
Handler for window close event .