Skip to content

Commit

Permalink
Cosmetic changes in snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 11, 2019
1 parent 7a9a8db commit bbf8b76
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions site/docs/4.2/components/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Note that closing an alert will remove it from the DOM.
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
| `$().alert('dispose')` | Destroys an element's alert. |

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

### Events

Expand All @@ -113,6 +113,6 @@ Bootstrap's alert plugin exposes a few events for hooking into alert functionali

{% highlight js %}
$('#myAlert').on('closed.bs.alert', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ All carousel events are fired at the carousel itself (i.e. at the `<div class="c

{% highlight js %}
$('#myCarousel').on('slide.bs.carousel', function () {
// do something
// do something...
})
{% endhighlight %}

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.2/components/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,6 @@ Bootstrap's collapse class exposes a few events for hooking into collapse functi

{% highlight js %}
$('#myCollapsible').on('hidden.bs.collapse', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,6 @@ All dropdown events are fired at the `.dropdown-menu`'s parent element and have

{% highlight js %}
$('#myDropdown').on('show.bs.dropdown', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Set heights using classes like `.form-control-lg` and `.form-control-sm`.
Add the `readonly` boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.

{% capture example %}
<input class="form-control" type="text" placeholder="Readonly input here" readonly>
<input class="form-control" type="text" placeholder="Readonly input here..." readonly>
{% endcapture %}
{% include example.html content=example %}

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.2/components/popovers.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,6 @@ Updates the position of an element's popover.

{% highlight js %}
$('#myPopover').on('hidden.bs.popover', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/scrollspy.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,6 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap

{% highlight js %}
$('[data-spy="scroll"]').on('activate.bs.scrollspy', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/toasts.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,6 @@ Hides an element's toast. Your toast will remain on the DOM but won't show anymo

{% highlight js %}
$('#myToast').on('hidden.bs.toast', function () {
// do something
// do something...
})
{% endhighlight %}
2 changes: 1 addition & 1 deletion site/docs/4.2/components/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,6 @@ Updates the position of an element's tooltip.

{% highlight js %}
$('#myTooltip').on('hidden.bs.tooltip', function () {
// do something
// do something...
})
{% endhighlight %}
11 changes: 6 additions & 5 deletions site/docs/4.2/getting-started/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ $('.btn.danger').button('toggle').addClass('fat')
All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):

{% highlight js %}
$('#myModal').modal() // initialized with defaults
$('#myModal').modal({ keyboard: false }) // initialized with no keyboard
$('#myModal').modal('show') // initializes and invokes show immediately
$('#myModal').modal() // initialized with defaults
$('#myModal').modal({ keyboard: false }) // initialized with no keyboard
$('#myModal').modal('show') // initializes and invokes show immediately
{% endhighlight %}

Each plugin also exposes its raw constructor on a `Constructor` property: `$.fn.popover.Constructor`. If you'd like to get a particular plugin instance, retrieve it directly from an element: `$('[rel="popover"]').data('popover')`.
Expand Down Expand Up @@ -100,7 +100,8 @@ $('#myCarousel').carousel('2') // !! Will be ignored, as the transition to the s
You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object:

{% highlight js %}
$.fn.modal.Constructor.Default.keyboard = false // changes default for the modal plugin's `keyboard` option to false
// changes default for the modal plugin's `keyboard` option to false
$.fn.modal.Constructor.Default.keyboard = false
{% endhighlight %}

## No conflict
Expand All @@ -109,7 +110,7 @@ Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In

{% highlight js %}
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
{% endhighlight %}

## Version numbers
Expand Down

0 comments on commit bbf8b76

Please sign in to comment.