- Patch #655740 by ksenzee, casey, aspilicious: fixed small JavaScript issues in the overlay module.
parent
2f6ba3399c
commit
a8cb00de11
|
@ -369,6 +369,8 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
|
||||||
registry_update();
|
registry_update();
|
||||||
// Refresh the schema to include it.
|
// Refresh the schema to include it.
|
||||||
drupal_get_schema(NULL, TRUE);
|
drupal_get_schema(NULL, TRUE);
|
||||||
|
// Clear entity cache.
|
||||||
|
entity_info_cache_clear();
|
||||||
|
|
||||||
// Now install the module if necessary.
|
// Now install the module if necessary.
|
||||||
if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) {
|
if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) {
|
||||||
|
|
|
@ -31,8 +31,8 @@ Drupal.behaviors.overlayChild = {
|
||||||
// may have decided to tell us the parent window to close the popup dialog.
|
// may have decided to tell us the parent window to close the popup dialog.
|
||||||
if (settings.closeOverlay) {
|
if (settings.closeOverlay) {
|
||||||
parent.Drupal.overlay.bindChild(window, true);
|
parent.Drupal.overlay.bindChild(window, true);
|
||||||
// Close the child window from a separate thread because the current
|
// Use setTimeout to close the child window from a separate thread,
|
||||||
// one is busy processing Drupal behaviors.
|
// because the current one is busy processing Drupal behaviors.
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
// We need to store the parent variable locally because it will
|
// We need to store the parent variable locally because it will
|
||||||
// disappear as soon as we close the iframe.
|
// disappear as soon as we close the iframe.
|
||||||
|
|
|
@ -517,7 +517,7 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
|
||||||
if (!$target.size()) {
|
if (!$target.size()) {
|
||||||
$target = self.$iframeDocument;
|
$target = self.$iframeDocument;
|
||||||
}
|
}
|
||||||
setTimeout(function () { $target.focus(); }, 10);
|
$target.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -528,16 +528,16 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
|
||||||
if (event.keyCode) {
|
if (event.keyCode) {
|
||||||
if (event.keyCode == $.ui.keyCode.TAB) {
|
if (event.keyCode == $.ui.keyCode.TAB) {
|
||||||
if (event.shiftKey && event.target == $firstTabbable.get(0)) {
|
if (event.shiftKey && event.target == $firstTabbable.get(0)) {
|
||||||
setTimeout(function () { $closeButton.focus(); }, 10);
|
$closeButton.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (!event.shiftKey && event.target == $lastTabbable.get(0)) {
|
else if (!event.shiftKey && event.target == $lastTabbable.get(0)) {
|
||||||
setTimeout(function () { $closeButton.focus(); }, 10);
|
$closeButton.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event.keyCode == $.ui.keyCode.ESCAPE) {
|
else if (event.keyCode == $.ui.keyCode.ESCAPE) {
|
||||||
setTimeout(function () { self.close(); }, 10);
|
self.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -548,11 +548,9 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
|
||||||
// close button of the dialog (default).
|
// close button of the dialog (default).
|
||||||
$(document).bind('keydown.overlay-event', function (event) {
|
$(document).bind('keydown.overlay-event', function (event) {
|
||||||
if (event.keyCode && event.keyCode == $.ui.keyCode.TAB) {
|
if (event.keyCode && event.keyCode == $.ui.keyCode.TAB) {
|
||||||
setTimeout(function () {
|
|
||||||
if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
|
if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
|
||||||
$closeButton.focus();
|
$closeButton.focus();
|
||||||
}
|
}
|
||||||
}, 10);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -157,6 +157,16 @@ class EnableDisableTestCase extends ModuleTestCase {
|
||||||
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
|
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
|
||||||
$this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
|
$this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests entity cache after enabling a module with a dependency on an enitity
|
||||||
|
* providing module.
|
||||||
|
*/
|
||||||
|
function testEntityCache() {
|
||||||
|
module_enable(array('entity_cache_test'));
|
||||||
|
$info = variable_get('entity_cache_test');
|
||||||
|
$this->assertNotNull($info, t('Entity information must not be NULL'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue