From: Julian Thilo Date: Mon, 17 Mar 2014 14:58:03 +0000 (+0100) Subject: Separate JS includes for alerts and popovers X-Git-Tag: v3.2.0~341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d52ad3ee3ba5a0fc51e1f06abeebd888846856eb;p=thirdparty%2Fbootstrap.git Separate JS includes for alerts and popovers /cc @mdo --- diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html new file mode 100644 index 0000000000..04bbd43cfc --- /dev/null +++ b/docs/_includes/js/alerts.html @@ -0,0 +1,71 @@ +
+

Alert messages alert.js

+ +

Example alerts

+

Add dismiss functionality to all alert messages with this plugin.

+
+ +
+ +
+ +
+ + +

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 %} + +

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.

+ +

.alert('close')

+

Closes an alert.

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

Events

+

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

+
+ + + + + + + + + + + + + + + + + +
Event TypeDescription
close.bs.alertThis event fires immediately when the close instance method is called.
closed.bs.alertThis event is fired when the alert has been closed (will wait for CSS transitions to complete).
+
+{% highlight js %} +$('#my-alert').bind('closed.bs.alert', function () { + // do something… +}) +{% endhighlight %} +
diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index 7bf515ad4b..56e3600aa4 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -263,79 +263,3 @@ $('#myPopover').on('hidden.bs.popover', function () { }) {% endhighlight %} - - - - -
-

Alert messages alert.js

- -

Example alerts

-

Add dismiss functionality to all alert messages with this plugin.

-
- -
- -
- -
- - -

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 %} - -

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.

- -

.alert('close')

-

Closes an alert.

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

Events

-

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

-
- - - - - - - - - - - - - - - - - -
Event TypeDescription
close.bs.alertThis event fires immediately when the close instance method is called.
closed.bs.alertThis event is fired when the alert has been closed (will wait for CSS transitions to complete).
-
-{% highlight js %} -$('#my-alert').bind('closed.bs.alert', function () { - // do something… -}) -{% endhighlight %} -
diff --git a/docs/javascript.html b/docs/javascript.html index c7671c7eac..e6151cb27c 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -13,6 +13,7 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug {% include js/tabs.html %} {% include js/tooltips.html %} {% include js/popovers.html %} +{% include js/alerts.html %} {% include js/buttons.html %} {% include js/collapse.html %} {% include js/carousel.html %}