]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add docs for how to change default JS plugin settings
authorKyle <kylemit@gmail.com>
Sat, 26 Jul 2014 21:55:18 +0000 (17:55 -0400)
committerChris Rebert <code@rebertia.com>
Mon, 4 Aug 2014 16:07:19 +0000 (09:07 -0700)
Closes #14250.

docs/_includes/js/overview.html

index 3aaba0980780376caf8622722812e09b2858790f..2a3c41a8b02d9f0b84cd9c3dbf03a955c4bcbd4e 100644 (file)
@@ -47,6 +47,12 @@ $('#myModal').modal('show')                // initializes and invokes show immed
 
   <p>Each plugin also exposes its raw constructor on a <code>Constructor</code> property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel="popover"]').data('popover')</code>.</p>
 
+  <h4>Default settings</h4>
+  <p>You can change the default settings for a plugin by modifying the plugin's <code>Constructor.DEFAULTS</code> object:<p>
+{% highlight js %}
+$.fn.modal.Constructor.DEFAULTS.keyboard = false // changes default for the modal plugin's `keyboard` option to false
+{% endhighlight %}
+
   <h3 id="js-noconflict">No conflict</h3>
   <p>Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call <code>.noConflict</code> on the plugin you wish to revert the value of.</p>
 {% highlight js %}