This patch enables customization of script defaults for plug-ins that depend on region fx. This includes fxAccorion and fxTabs.

To change them, add the following to the .info file of your theme.

Example:

// REGION_FX_PLUGIN[BLOCK_REGION_KEY][OPTION] = VALUE

fxTabs[sidebar_accordion][vjustify] = false

The scripts always had the following options but there was no way to change them.

For reference, here are all the defaults for fxTabs:

activate: null,                       // The tab set to show on page load. Use
                                      // a numeric position starting at 0 or a
                                      // html ID pointing to the
                                      // header or content without the hash.
                                      // Setting this to null will restore the
                                      // previous state.

applyClass: 'fx-tabs',                // Classname to apply to the passed object.
                                      // Use as a contextual CSS selector for
                                      // styling.

currentClass: 'fx-active',            // Classname to apply to the LI of the
                                      // selected tab.

tabheadClass: 'fx-titles',            // Classname to apply to the UL of the
                                      // tab group.

contentClass: 'fx-contents',          // Classname to apply to the content wrapper.

headerSelect: '.block-title',         // Query Selector of the Elements to
                                      // Transform the Tabs-Navigation from
                                      // (originals are removed).

contentSelect: '.block',              // Query Selector of the Elements to be
                                      // treated as the Tab Body.

fx: 'fadeIn',                         // can be "fadeIn", "slideDown", "show".

fxspeed: 'normal',                    // speed (String|Number): "slow", "normal",
                                      // or "fast") or the number of milliseconds
                                      // to run the animation.

currentTabTag: 'h2',                  // A heading tag for the currently active
                                      // tab. This is used for screenreaders and
                                      // will be hidden.

currentInfoText: 'current tab: ',     // text to indicate for screenreaders which
                                      // tab is the current one

currentInfoPosition: 'prepend',       // Definition where to insert the Info Text.
                                      // Can be either "prepend" or "append"

currentInfoClass: 'fx-current-info',  // Class to apply to the span wrapping
                                      // the CurrentInfoText.

highlightTrigger: '.active, .active-trail, .active-menu',
                                      // Query Selector to trigger the next option
                                      // when there's a matche in the tab content.

highlightClass: 'page-active',        // Classname to apply to the LI tab head
                                      // and tab body.

vjustify: true                        // Justifies the height of each tab body.

And the options for fxAccordion:

activate: null,                       // The accordion item to show on page load.
                                      // Use a numeric position starting at 0 or
                                      // a html ID pointing to the header, content
                                      // or the immediat parent without the hash.
                                      // Setting this to null will restore the
                                      // previous state.

applyClass: 'fx-accordion',           // Classname to apply to the passed object.
                                      // Use as a contextual CSS selector for styling.

currentClass: 'fx-active',            // Classname to apply to the expanded accordion
                                      // header and content.

headerClass: 'fx-header',             // Classname to apply to the accordion header.

contentClass: 'fx-content',           // Classname to apply to the content body.

headerSelect:  '.block-title',        // Query Selector of the header.

contentSelect: '.block-content',      // Query Selector of the body.

fxspeed: 'normal',                    // speed (String|Number): "slow", "normal",
                                      // or "fast") or the number of milliseconds
                                      // to run the animation.

currentFocusText: ': in current focus',
                                      // text to indicate for screenreaders on
                                      // which accordion is in focus.

highlightTrigger: '.active, .active-trail, .active-menu',
                                      // Query Selector to trigger the next option
                                      // when there's a match in the content.

highlightClass: 'page-active'         // Classname to apply to the head and body.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dvessel’s picture

Status: Active » Needs review
FileSize
3.7 KB

The patch.

dvessel’s picture

FileSize
3.89 KB

This patch does a better job of forcing type changes.

'true' or 'false' will be booleans in javascript and integers are handled better.

dvessel’s picture

FileSize
3.89 KB

Typo in the code comments.

penguininja’s picture

The patch from comment #3 works great. Thanks! This is a great addition to Hexagon.

dvessel’s picture

Status: Needs review » Fixed

Great! Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.