2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

add button to toggle the optional theme when viewing the docs; fixes #9764

This commit is contained in:
Chris Rebert
2014-04-29 15:54:05 -07:00
parent f0daa64a29
commit 7d0f7e8441
4 changed files with 31 additions and 0 deletions
+6
View File
@@ -1452,3 +1452,9 @@ h1[id] {
-webkit-box-shadow: 0 0 8px rgba(82,168,236,.6);
box-shadow: 0 0 8px rgba(82,168,236,.6);
}
#bs-theme-btn {
position: fixed;
bottom: 0;
left: 0;
}
+16
View File
@@ -53,6 +53,22 @@
$('.bs-top').affix()
}, 100)
// theme toggler
;(function () {
var stylesheetLink = $('#bs-theme-stylesheet')
var themeBtn = $('#bs-theme-btn')
themeBtn.click(function () {
if (stylesheetLink.attr('href')) {
stylesheetLink.attr('href', '')
themeBtn.text('Activate Theme')
}
else {
stylesheetLink.attr('href', stylesheetLink.attr('data-href'))
themeBtn.text('Deactivate Theme')
}
})
})();
// tooltip demo
$('.tooltip-demo').tooltip({
selector: '[data-toggle="tooltip"]',