diff options
| author | Mark Otto <[email protected]> | 2014-05-22 19:20:32 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-05-22 19:20:32 -0700 |
| commit | 68de4bf387650aa83f5138ef114adf88f40f9871 (patch) | |
| tree | efb528f8b9b1459e8a3d57a61cefcd9942cd8273 /docs/assets/js/_src | |
| parent | fab9ab8fe9b51ebc88872482556df3f793e5ac4a (diff) | |
| parent | 326f6b2b873e7bd888204f754ebe394bbb124c56 (diff) | |
| download | bootstrap-68de4bf387650aa83f5138ef114adf88f40f9871.tar.xz bootstrap-68de4bf387650aa83f5138ef114adf88f40f9871.zip | |
Merge pull request #13463 from twbs/docs-theme-toggler
add button to toggle the optional theme when viewing the docs
Diffstat (limited to 'docs/assets/js/_src')
| -rw-r--r-- | docs/assets/js/_src/application.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/assets/js/_src/application.js b/docs/assets/js/_src/application.js index 08ca5f907..74556a3da 100644 --- a/docs/assets/js/_src/application.js +++ b/docs/assets/js/_src/application.js @@ -53,6 +53,23 @@ $('.bs-top').affix() }, 100) + // theme toggler + ;(function () { + var stylesheetLink = $('#bs-theme-stylesheet') + var themeBtn = $('.bs-docs-theme-toggle') + themeBtn.click(function () { + var href = stylesheetLink.attr('href'); + if (!href || href.indexOf('data') === 0) { + stylesheetLink.attr('href', stylesheetLink.attr('data-href')) + themeBtn.text('Disable theme preview') + } + else { + stylesheetLink.attr('href', '') + themeBtn.text('Preview theme') + } + }) + })(); + // tooltip demo $('.tooltip-demo').tooltip({ selector: '[data-toggle="tooltip"]', |
