From 7d0f7e84412ab8018e6e9211f9e6a0f47d1100ce Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 29 Apr 2014 15:54:05 -0700 Subject: add button to toggle the optional theme when viewing the docs; fixes #9764 --- docs/assets/js/_src/application.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/assets/js/_src') diff --git a/docs/assets/js/_src/application.js b/docs/assets/js/_src/application.js index 08ca5f907..655f14612 100644 --- a/docs/assets/js/_src/application.js +++ b/docs/assets/js/_src/application.js @@ -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"]', -- cgit v1.2.3 From bdd822a94cdf2d452e067569e76ca1537dc74d8d Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 29 Apr 2014 15:56:18 -0700 Subject: regenerate minified docs JS & CSS --- docs/assets/js/_src/application.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs/assets/js/_src') diff --git a/docs/assets/js/_src/application.js b/docs/assets/js/_src/application.js index 655f14612..0a719b1f9 100644 --- a/docs/assets/js/_src/application.js +++ b/docs/assets/js/_src/application.js @@ -58,14 +58,15 @@ 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 { + var href = stylesheetLink.attr('href'); + if (!href || href.indexOf('data') === 0) { stylesheetLink.attr('href', stylesheetLink.attr('data-href')) themeBtn.text('Deactivate Theme') } + else { + stylesheetLink.attr('href', '') + themeBtn.text('Activate Theme') + } }) })(); -- cgit v1.2.3 From 12b5d46f17a125021c5083fbc88b53a7fb86a096 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 22 May 2014 18:38:43 -0700 Subject: move it to the sidebar --- docs/assets/js/_src/application.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/assets/js/_src') diff --git a/docs/assets/js/_src/application.js b/docs/assets/js/_src/application.js index 0a719b1f9..74556a3da 100644 --- a/docs/assets/js/_src/application.js +++ b/docs/assets/js/_src/application.js @@ -56,16 +56,16 @@ // theme toggler ;(function () { var stylesheetLink = $('#bs-theme-stylesheet') - var themeBtn = $('#bs-theme-btn') + 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('Deactivate Theme') + themeBtn.text('Disable theme preview') } else { stylesheetLink.attr('href', '') - themeBtn.text('Activate Theme') + themeBtn.text('Preview theme') } }) })(); -- cgit v1.2.3