From f9349f36dfbfda7bf755f458d856d45d07745f29 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Thu, 17 Jul 2014 03:53:49 +0200 Subject: [PATCH 1/3] Clean up Affix documentation --- docs/_includes/js/affix.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/_includes/js/affix.html b/docs/_includes/js/affix.html index 4ce51cb34b..56168d6a89 100644 --- a/docs/_includes/js/affix.html +++ b/docs/_includes/js/affix.html @@ -14,8 +14,8 @@

Here's how the affix plugin works:

  1. To start, the plugin adds .affix-top to indicate the element is in its top-most position. At this point no CSS positioning is required.
  2. -
  3. Scrolling past the element you want affixed should trigger the actual affixing. This is where .affix replaces .affix-top and sets position: fixed; (provided by Bootstrap's code CSS).
  4. -
  5. If a bottom offset is defined, scrolling past that should replace .affix with .affix-bottom. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add position: absolute; when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.
  6. +
  7. Scrolling past the element you want affixed should trigger the actual affixing. This is where .affix replaces .affix-top and sets position: fixed; (provided by Bootstrap's CSS).
  8. +
  9. If a bottom offset is defined, scrolling past it should replace .affix with .affix-bottom. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add position: absolute; when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.

Follow the above steps to set your CSS for either of the usage options below.

@@ -31,14 +31,14 @@

Via JavaScript

Call the affix plugin via JavaScript:

{% highlight js %} - $('#my-affix').affix({ - offset: { - top: 100 - , bottom: function () { - return (this.bottom = $('.footer').outerHeight(true)) - } +$('#myAffix').affix({ + offset: { + top: 100, + bottom: function () { + return (this.bottom = $('.footer').outerHeight(true)) } - }) + } +}) {% endhighlight %} @@ -75,7 +75,7 @@

Events

-

Bootstrap's affix class exposes a few events for hooking into affix functionality.

+

Bootstrap's affix plugin exposes a few events for hooking into affix functionality.

From 31772677f959bf449fee2a57805da66476d8eec8 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Thu, 17 Jul 2014 04:11:21 +0200 Subject: [PATCH 2/3] Clean up the Alert documentation --- docs/_includes/js/alerts.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html index e9cb8c871b..5b7f4e10c3 100644 --- a/docs/_includes/js/alerts.html +++ b/docs/_includes/js/alerts.html @@ -24,21 +24,25 @@

Usage

-

Enable dismissal of an alert via JavaScript:

- {% highlight js %}$(".alert").alert(){% endhighlight %} -

Markup

Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

- {% highlight html %}{% endhighlight %} + +{% highlight html %} + +{% endhighlight %} + +

To have your alerts use animation when closing, make sure they have the .fade and .in class already applied to them.

Methods

$().alert()

-

Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

+

Makes an alert listen for click events on descendant elements which have the data-dismiss="alert" attribute. (Not necessary when using the data-api's auto-initialization.)

-

.alert('close')

+

$().alert('close')

Closes an alert.

- {% highlight js %}$(".alert").alert('close'){% endhighlight %}

Events

@@ -64,7 +68,7 @@
{% highlight js %} -$('#my-alert').on('closed.bs.alert', function () { +$('#myAlert').on('closed.bs.alert', function () { // do something… }) {% endhighlight %} From 38335b2a3dcaac8bb706b5542e10f8edd8ea6a5e Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Thu, 17 Jul 2014 04:33:30 +0200 Subject: [PATCH 3/3] Merge alert examples and add `.bs-example-standalone` class --- docs/_includes/js/alerts.html | 4 +--- docs/assets/css/src/docs.css | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html index 5b7f4e10c3..2f6b33368a 100644 --- a/docs/_includes/js/alerts.html +++ b/docs/_includes/js/alerts.html @@ -3,14 +3,12 @@

Example alerts

Add dismiss functionality to all alert messages with this plugin.

-
+
-
-