diff options
Diffstat (limited to 'docs/assets/js/src')
| -rw-r--r-- | docs/assets/js/src/application.js | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js index 529b0c1b8..b98c3a5ea 100644 --- a/docs/assets/js/src/application.js +++ b/docs/assets/js/src/application.js @@ -4,16 +4,16 @@ /*! * JavaScript for Bootstrap's docs (https://getbootstrap.com) - * Copyright 2011-2016 The Bootstrap Authors - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2017 The Bootstrap Authors + * Copyright 2011-2017 Twitter, Inc. * Licensed under the Creative Commons Attribution 3.0 Unported License. For * details, see https://creativecommons.org/licenses/by/3.0/. */ /* global Clipboard, anchors */ -!function ($) { - 'use strict'; +(function ($) { + 'use strict' $(function () { @@ -48,11 +48,23 @@ $modal.find('.modal-body input').val(recipient) }) + // Activate animated progress bar + $('.bd-toggle-animated-progress').on('click', function () { + $(this).siblings('.progress').find('.progress-bar-striped').toggleClass('progress-bar-animated') + }) + // Insert copy to clipboard button before .highlight $('.highlight').each(function () { - var btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>' + var btnHtml = '<div class="bd-clipboard"><button class="btn-clipboard" title="Copy to clipboard">Copy</button></div>' $(this).before(btnHtml) - $('.btn-clipboard').tooltip() + $('.btn-clipboard') + .tooltip() + .on('mouseleave', function () { + // explicitly hide tooltip, since after clicking it remains + // focused (as it's a button), so tooltip would otherwise + // remain visible until focus is moved away + $(this).tooltip('hide') + }) }) var clipboard = new Clipboard('.btn-clipboard', { @@ -86,11 +98,11 @@ }) -}(jQuery) +}(jQuery)) ;(function () { - 'use strict'; + 'use strict' - anchors.options.placement = 'left'; + anchors.options.placement = 'left' anchors.add('.bd-content > h1, .bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5') -})(); +}()) |
