Created
July 24, 2014 13:10
-
-
Save angry-dan/62824f5a0827b0cc8fa5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable overlay | |
// @namespace http://angrydan.example.com | |
// @description Disable the Drupal overlay | |
// @include * | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// Drupal.ajaxError was introduced in D7. D6 won't have it. | |
if (typeof Drupal !== "undefined" && typeof Drupal.ajaxError !== 'undefined') { | |
if (Drupal.behaviors.overlayParent) { | |
delete Drupal.behaviors.overlayParent.attach; | |
} | |
// Following an AJAX call this function will be back, and Drupal will execute it. | |
// So we do this now, to ensure we will be jumping the queue in future. | |
Drupal.behaviors.preventOverlay = { | |
attach: function(){ | |
if (Drupal.behaviors.overlayParent) { | |
delete Drupal.behaviors.overlayParent.attach; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment