src/components/dialog/dialog.js
function onRemove(scope, element, options) {
      options.deactivateListeners();
      options.unlockScreenReader();
      options.hideBackdrop(options.$destroy);

      // Remove the focus traps that we added earlier for keeping focus within the dialog.
      if (topFocusTrap && topFocusTrap.parentNode) {
        topFocusTrap.parentNode.removeChild(topFocusTrap);
      }

      if (bottomFocusTrap && bottomFocusTrap.parentNode) {
        bottomFocusTrap.parentNode.removeChild(bottomFocusTrap);
      }

      // For navigation $destroy events, do a quick, non-animated removal,
      // but for normal closes (from clicks, etc) animate the removal
      return options.$destroy ? detachAndClean() : animateRemoval().then(detachAndClean);

      /**
       * For normal closes, animate the removal.
       * For forced closes (like $destroy events), skip the animations
       */
      function animateRemoval() {
        return dialogPopOut(element, options);
      }

      /**
       * Detach the element
       */
      function detachAndClean() {
        angular.element($document[0].body).removeClass('md-dialog-is-showing');

        // Reverse the container stretch if using a content element.
        if (options.contentElement) {
          options.reverseContainerStretch();
        }

        // Exposed cleanup function from the $mdCompiler.
        options.cleanupElement();

        // Restores the focus to the origin element if the last interaction upon opening was a keyboard.
        if (!options.$destroy && options.originInteraction === 'keyboard') {
          options.origin.focus();
        }
      }
    }
function onRemove(scope, element, options) {
      options.deactivateListeners();
      options.unlockScreenReader();
      options.hideBackdrop(options.$destroy);

      // Remove the focus traps that we added earlier for keeping focus within the dialog.
      if (topFocusTrap && topFocusTrap.parentNode) {
        topFocusTrap.parentNode.removeChild(topFocusTrap);
      }

      if (bottomFocusTrap && bottomFocusTrap.parentNode) {
        bottomFocusTrap.parentNode.removeChild(bottomFocusTrap);
      }

      // For navigation $destroy events, do a quick, non-animated removal,
      // but for normal closes (from clicks, etc) animate the removal
      return options.$destroy ? detachAndClean() : animateRemoval().then(detachAndClean);

      /**
       * For normal closes, animate the removal.
       * For forced closes (like $destroy events), skip the animations
       */
      function animateRemoval() {
        return dialogPopOut(element, options);
      }

      /**
       * Detach the element
       */
      function detachAndClean() {
        angular.element($document[0].body).removeClass('md-dialog-is-showing');

        // Reverse the container stretch if using a content element.
        if (options.contentElement) {
          options.reverseContainerStretch();
        }

        // Exposed cleanup function from the $mdCompiler.
        options.cleanupElement();

        // Restores the focus to the origin element if the last interaction upon opening was a keyboard.
        if (!options.$destroy && options.originInteraction === 'keyboard') {
          options.origin.focus();
        }
      }
    }
function onRemove ( scope , element , options ) { options . deactivateListeners ( ) ; options . unlockScreenReader ( ) ; options . hideBackdrop ( options . $destroy ) ; // Remove the focus traps that we added earlier for keeping focus within the dialog. if ( topFocusTrap && topFocusTrap . parentNode ) { topFocusTrap . parentNode . removeChild ( topFocusTrap ) ; } if ( bottomFocusTrap && bottomFocusTrap . parentNode ) { bottomFocusTrap . parentNode . removeChild ( bottomFocusTrap ) ; } // For navigation $destroy events, do a quick, non-animated removal, // but for normal closes (from clicks, etc) animate the removal return options . $destroy ? detachAndClean ( ) : animateRemoval ( ) . then ( detachAndClean ) ; /**
       * For normal closes, animate the removal.
       * For forced closes (like $destroy events), skip the animations
       */ function animateRemoval ( ) { return dialogPopOut ( element , options ) ; } /**
       * Detach the element
       */ function detachAndClean ( ) { angular . element ( $document [ 0 ] . body ) . removeClass ( 'md-dialog-is-showing' ) ; // Reverse the container stretch if using a content element. if ( options . contentElement ) { options . reverseContainerStretch ( ) ; } // Exposed cleanup function from the $mdCompiler. options . cleanupElement ( ) ; // Restores the focus to the origin element if the last interaction upon opening was a keyboard. if ( ! options . $destroy && options . originInteraction === 'keyboard' ) { options . origin . focus ( ) ; } } }
Remove function for all dialogs
Remove function for all dialogs