]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Allows you to configure which element to append the reveal 3881/head
authorFilmKnurd <andrew@astonishdesign.com>
Fri, 13 Dec 2013 02:27:28 +0000 (20:27 -0600)
committerFilmKnurd <andrew@astonishdesign.com>
Fri, 13 Dec 2013 02:27:28 +0000 (20:27 -0600)
commita224fdee7d69853d3b01fd2c8aa7c948ea3c6325
tree6f482dcc05f353ca2ac6c849199558b377b6f5db
parente3e76cc2528af46bc5f8600d2856015cdd015042
Allows you to configure which element to append the reveal

  - Checks for the existance of rootElement in the settings object
  - Uses rootElement if it is set, otherwise it appends the reveal
    to <body>

**Depends on PR:** #3743

Usage
----------

To change the element, pass in an a settings object on initialization:
```JS
$(document).foundation( 'reveal', { rootElement: '#alternate-element'})
```
Or on open:
```JS
$('#myModal').foundation( 'reveal', 'open', { rootElement: '#alternate-element' });
```
Purpose
------------
In a QUnit test environment, I needed the reveal to stay within the
confines of the testing sandbox, so that the app code under test
retained access to the modal.

This feature is transparent, if no rootElement is specified, then
reveal behaves exactly as expected. But, if you need to attach the
reveal to another element, then you can.
js/foundation/foundation.reveal.js