Skip to content
Snippets Groups Projects
Commit f91185ed authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Issue #1827016 by Anybody: Added further admin options to close layer.

parent 3d6f11f6
No related branches found
No related tags found
No related merge requests found
......@@ -53,5 +53,19 @@ function jquery_loadinganimation_settings_form() {
'#required' => FALSE,
'#default_value' => variable_get('jquery_loadinganimation_settings_form',
''));
$form['jquery_loadinganimation_close_on_click'] = array(
'#type' => 'checkbox',
'#title' => t('Close on layer click'),
'#description' => t(
"Close the layer if user clicks on it while loading process is still in progress."),
'#default_value' => variable_get('jquery_loadinganimation_close_on_click',
TRUE));
$form['jquery_loadinganimation_close_on_esc'] = array(
'#type' => 'checkbox',
'#title' => t('Close on ESC press'),
'#description' => t(
"Close the layer if user presses ESC while loading process is still in progress."),
'#default_value' => variable_get('jquery_loadinganimation_close_on_esc',
TRUE));
return system_settings_form($form);
}
\ No newline at end of file
......@@ -68,17 +68,21 @@
}
// Hide on animation click!
$("div#loadinganimation").live('click', function() {
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
});
if (Drupal.settings.jquery_loadinganimation.close_on_click) {
$("div#loadinganimation").live('click', function() {
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
});
}
// Hide on ESC press.
$(document).keyup(function(event) {
var keycode = event.which;
if (keycode == 27) { // escape, close box
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
}
});
if (Drupal.settings.jquery_loadinganimation.close_on_esc) {
$(document).keyup(function(event) {
var keycode = event.which;
if (keycode == 27) { // escape, close box
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
}
});
}
};
// Initialize!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment