From 3f2c43514d208ed63b16d08bc6e0ba304556719b Mon Sep 17 00:00:00 2001 From: jcmartinez Date: Thu, 25 Apr 2013 21:43:55 -0400 Subject: [PATCH] Issue #1980164 by jcmartinez: Added configuration options for Animation and Speed. --- modal_forms.admin.inc | 18 ++++++++++++++++++ modal_forms.module | 9 ++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/modal_forms.admin.inc b/modal_forms.admin.inc index 77dd7f1..7d00eb1 100644 --- a/modal_forms.admin.inc +++ b/modal_forms.admin.inc @@ -111,6 +111,24 @@ function modal_forms_admin_settings() { '#required' => TRUE, '#description' => t('The opacity of the background behind the modal. Should be entered as a decimal value (eg 0.85 = 85% opacity).'), ); + $form['modal_forms_custom_settings']['modal_forms_animation'] = array( + '#type' => 'textfield', + '#title' => t('Animation'), + '#default_value' => variable_get('modal_forms_animation', 'show'), + '#size' => 9, + '#maxlength' => 9, + '#required' => FALSE, + '#description' => t('Either: show, "fadeIn" or "slideDown". Defaults to "show".'), + ); + $form['modal_forms_custom_settings']['modal_forms_speed'] = array( + '#type' => 'textfield', + '#title' => t('Animation speed'), + '#default_value' => variable_get('modal_forms_speed', 'fast'), + '#size' => 9, + '#maxlength' => 9, + '#required' => TRUE, + '#description' => t('The speed of the animation. Defaults to "fast"'), + ); // Modal popup size settings $modal_types = array('fixed' => t('Fixed'), 'scale' => t('Scale')); diff --git a/modal_forms.module b/modal_forms.module index 8c4645d..38bb820 100644 --- a/modal_forms.module +++ b/modal_forms.module @@ -209,7 +209,8 @@ function _modal_forms_doheader() { 'opacity' => floatval(variable_get('modal_forms_opacity', 0.85)), 'background' => variable_get('modal_forms_background_color', '#000'), ), - 'animation' => 'fadeIn', + 'animation' => variable_get('modal_forms_animation', 'show'), + 'animationSpeed' => variable_get('modal_forms_speed', 'fast'), 'modalTheme' => 'ModalFormsPopup', 'throbber' => $throbber, 'closeText' => t('Close'), @@ -224,7 +225,8 @@ function _modal_forms_doheader() { 'opacity' => floatval(variable_get('modal_forms_opacity', 0.85)), 'background' => variable_get('modal_forms_background_color', '#000'), ), - 'animation' => 'fadeIn', + 'animation' => variable_get('modal_forms_animation', 'show'), + 'animationSpeed' => variable_get('modal_forms_speed', 'fast'), 'modalTheme' => 'ModalFormsPopup', 'throbber' => $throbber, 'closeText' => t('Close'), @@ -239,7 +241,8 @@ function _modal_forms_doheader() { 'opacity' => floatval(variable_get('modal_forms_opacity', 0.85)), 'background' => variable_get('modal_forms_background_color', '#000'), ), - 'animation' => 'fadeIn', + 'animation' => variable_get('modal_forms_animation', 'show'), + 'animationSpeed' => variable_get('modal_forms_speed', 'fast'), 'modalTheme' => 'ModalFormsPopup', 'throbber' => $throbber, 'closeText' => t('Close'), -- 1.7.9.5