Skip to content

Instantly share code, notes, and snippets.

@angry-dan
Created July 24, 2014 13:10
Show Gist options
  • Save angry-dan/62824f5a0827b0cc8fa5 to your computer and use it in GitHub Desktop.
Save angry-dan/62824f5a0827b0cc8fa5 to your computer and use it in GitHub Desktop.
// ==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