From 99f6f700f47154c8126bfbdceadcd3a45627801a Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:12:18 -0700 Subject: [PATCH 1/6] docs: sort tooltip & container options for sanity --- docs/_includes/js/popovers.html | 80 ++++++++++++++++----------------- docs/_includes/js/tooltips.html | 36 +++++++-------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index b2f58fbc48..a3e5f81cdd 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -152,45 +152,11 @@ $('.popover-dismiss').popover({ Apply a CSS fade transition to the popover - html - boolean + container + string | false false - Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks. - - - placement - string | function - 'right' - How to position the popover - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right. - - - selector - string - false - If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. - - - trigger - string - 'click' - How popover is triggered - click | hover | focus | manual - - - title - string | function - '' - Default title value if title attribute isn't present - - - template - string - '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' -

Base HTML to use when creating the popover.

-

The popover's title will be injected into the .popover-title.

-

The popover's content will be injected into the .popover-content.

-

.arrow will become the popover's arrow.

-

The outermost wrapper element should have the .popover class.

+

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

@@ -213,13 +179,47 @@ $('.popover-dismiss').popover({ - container - string | false + html + boolean false + Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks. + + + placement + string | function + 'right' + How to position the popover - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right. + + + selector + string + false + If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. + + + template + string + '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' -

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

+

Base HTML to use when creating the popover.

+

The popover's title will be injected into the .popover-title.

+

The popover's content will be injected into the .popover-content.

+

.arrow will become the popover's arrow.

+

The outermost wrapper element should have the .popover class.

+ + title + string | function + '' + Default title value if title attribute isn't present + + + trigger + string + 'click' + How popover is triggered - click | hover | focus | manual + diff --git a/docs/_includes/js/tooltips.html b/docs/_includes/js/tooltips.html index 64ea06e85e..4d91da640b 100644 --- a/docs/_includes/js/tooltips.html +++ b/docs/_includes/js/tooltips.html @@ -90,6 +90,24 @@ $('#example').tooltip(options) true Apply a CSS fade transition to the tooltip + + container + string | false + false + +

Appends the tooltip to a specific element. Example: container: 'body'

+ + + + delay + number | object + 0 + +

Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { show: 500, hide: 100 }

+ + html boolean @@ -131,24 +149,6 @@ $('#example').tooltip(options) 'hover focus' How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. - - delay - number | object - 0 - -

Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

-

If a number is supplied, delay is applied to both hide/show

-

Object structure is: delay: { show: 500, hide: 100 }

- - - - container - string | false - false - -

Appends the tooltip to a specific element. Example: container: 'body'

- - viewport string | object From 90cfa1a44de353d1b0a8aef080e267bd765159e3 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:17:24 -0700 Subject: [PATCH 2/6] add 'viewport' option to popover docs; #12328 erratum --- docs/_includes/js/popovers.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index a3e5f81cdd..174e9969a1 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -220,6 +220,14 @@ $('.popover-dismiss').popover({ 'click' How popover is triggered - click | hover | focus | manual + + viewport + string | object + { selector: 'body', padding: 0 } + +

Keeps the popover within the bounds of this element. Example: viewport: '#viewport' or { selector: '#viewport', padding: 0 }

+ + From e839a4999559eeea4a74dfeebb16428a48b44728 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:18:33 -0700 Subject: [PATCH 3/6] add multiple triggers info to popover docs --- docs/_includes/js/popovers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index 174e9969a1..05778bc975 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -218,7 +218,7 @@ $('.popover-dismiss').popover({ trigger string 'click' - How popover is triggered - click | hover | focus | manual + How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. viewport From 6fdbd8e3cf90d1beaccc60396d30303287b4b1b8 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:19:50 -0700 Subject: [PATCH 4/6] add 'selector' option motivation to tooltip docs --- docs/_includes/js/tooltips.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_includes/js/tooltips.html b/docs/_includes/js/tooltips.html index 4d91da640b..72096b3689 100644 --- a/docs/_includes/js/tooltips.html +++ b/docs/_includes/js/tooltips.html @@ -124,7 +124,7 @@ $('#example').tooltip(options) selector string false - If a selector is provided, tooltip objects will be delegated to the specified targets. + If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have tooltips added. See this and an informative example. template From 3465d984fb934b1616b8d4ecf394b997cd1f0fab Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:23:58 -0700 Subject: [PATCH 5/6] add 'container' option motivation to tooltip docs --- docs/_includes/js/tooltips.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_includes/js/tooltips.html b/docs/_includes/js/tooltips.html index 72096b3689..e967878f86 100644 --- a/docs/_includes/js/tooltips.html +++ b/docs/_includes/js/tooltips.html @@ -95,7 +95,7 @@ $('#example').tooltip(options) string | false false -

Appends the tooltip to a specific element. Example: container: 'body'

+

Appends the tooltip to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.

From 00fcf072c6955b1e5ba51298db1026c91783eef6 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 14 May 2014 18:43:14 -0700 Subject: [PATCH 6/6] update default 'template' value in popover docs --- docs/_includes/js/popovers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index 05778bc975..2ee6707415 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -199,7 +199,7 @@ $('.popover-dismiss').popover({ template string - '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' + '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'

Base HTML to use when creating the popover.

The popover's title will be injected into the .popover-title.