From 5f65df9e2db7c16c3c64930331a467e18501e20c Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 10 Sep 2011 14:04:22 -0700 Subject: [PATCH 1/2] add some more events to alerts and modal and update docs --- docs/javascript.html | 44 ++++++++++++++++++++++++++++++++++++++---- js/bootstrap-alerts.js | 9 +++++---- js/bootstrap-modal.js | 8 +++++--- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/docs/javascript.html b/docs/javascript.html index 8a4636bb3d..47cd34414b 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -85,9 +85,9 @@ $('#modal-content').modal({ closeOnEscape: true })

Events

-

Trigger events to make things happen!

+

Bootstraps modal class makes use of custom events. You can use trigger to make things happen manually or bind to listen for things happening.

modal:toggle

-

Toggle the modal open state.

+

Toggle the modal open state.

$('#modal-content').trigger('modal:toggle')

modal:show

Opens the modal.

@@ -95,8 +95,21 @@ $('#modal-content').modal({

modal:hide

Closes the modal.

$('#modal-content').trigger('modal:hide')
+

modal:shown

+

Fired when the modal has been made visible.

+
+$('#modal-content')
+  .bind('modal:shown', function () {
+    // do something here...
+  })
+

modal:hidden

+

Fired when the modal has become hidden

+
+$('#modal-content')
+  .bind('modal:hidden', function () {
+    $(this).remove() // cleanup jQuery plugin data on hide
+  })

Demo

- @@ -1437,15 +1422,15 @@ Lorem ipsum dolar sit amet illo error ipsum verita bootstrap-dropdown.js - This plugin is for adding dropdown to the bootstrap nav. + This plugin is for adding dropdowns to the bootstrap topbar or tabbed navigations. bootstrap-tabs.js - This plugin adds quick, dynamic tab and pill functionality. + This plugin adds quick, dynamic tab and pill functionality for cycling through local content. bootstrap-twipsy.js - Based on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for title storage! + Based on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for local title storage! bootstrap-popover.js diff --git a/lib/patterns.less b/lib/patterns.less index 0fb7193c2c..3e0f56209b 100644 --- a/lib/patterns.less +++ b/lib/patterns.less @@ -829,6 +829,9 @@ input[type=submit].btn { font-size: 11px; z-index: 1000; .opacity(80); + &.fade.in { + .opacity(80); + } &.above .twipsy-arrow { #popoverArrow > .above(); } &.left .twipsy-arrow { #popoverArrow > .left(); } &.below .twipsy-arrow { #popoverArrow > .below(); }