1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-30 15:29:06 +02:00

Comply to the new JSCS rules.

This commit is contained in:
XhmikosR
2015-04-29 12:11:58 +03:00
parent 93785be2c6
commit 49c4556354
5 changed files with 56 additions and 50 deletions

View File

@@ -58,12 +58,12 @@
// theme toggler
;(function () {
var stylesheetLink = $('#bs-theme-stylesheet')
var themeBtn = $('.bs-docs-theme-toggle')
var $stylesheetLink = $('#bs-theme-stylesheet')
var $themeBtn = $('.bs-docs-theme-toggle')
var activateTheme = function () {
stylesheetLink.attr('href', stylesheetLink.attr('data-href'))
themeBtn.text('Disable theme preview')
$stylesheetLink.attr('href', $stylesheetLink.attr('data-href'))
$themeBtn.text('Disable theme preview')
localStorage.setItem('previewTheme', true)
}
@@ -71,13 +71,13 @@
activateTheme()
}
themeBtn.click(function () {
var href = stylesheetLink.attr('href')
$themeBtn.click(function () {
var href = $stylesheetLink.attr('href')
if (!href || href.indexOf('data') === 0) {
activateTheme()
} else {
stylesheetLink.attr('href', '')
themeBtn.text('Preview theme')
$stylesheetLink.attr('href', '')
$themeBtn.text('Preview theme')
localStorage.removeItem('previewTheme')
}
})
@@ -102,22 +102,22 @@
// Button state demo
$('#loading-example-btn').on('click', function () {
var btn = $(this)
btn.button('loading')
var $btn = $(this)
$btn.button('loading')
setTimeout(function () {
btn.button('reset')
$btn.button('reset')
}, 3000)
})
// Modal relatedTarget demo
$('#exampleModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var recipient = button.data('whatever') // Extract info from data-* attributes
var $button = $(event.relatedTarget) // Button that triggered the modal
var recipient = $button.data('whatever') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('.modal-title').text('New message to ' + recipient)
modal.find('.modal-body input').val(recipient)
var $modal = $(this)
$modal.find('.modal-title').text('New message to ' + recipient)
$modal.find('.modal-body input').val(recipient)
})
// Activate animated progress bar
@@ -137,11 +137,11 @@
$(this).before(btnHtml)
})
var zeroClipboard = new ZeroClipboard($('.btn-clipboard'))
var htmlBridge = $('#global-zeroclipboard-html-bridge')
var $htmlBridge = $('#global-zeroclipboard-html-bridge')
// Handlers for ZeroClipboard
zeroClipboard.on('load', function () {
htmlBridge
$htmlBridge
.data('placement', 'top')
.attr('title', 'Copy to clipboard')
.tooltip()
@@ -155,7 +155,7 @@
// Notify copy success and reset tooltip title
zeroClipboard.on('complete', function () {
htmlBridge
$htmlBridge
.attr('title', 'Copied!')
.tooltip('fixTitle')
.tooltip('show')
@@ -177,5 +177,6 @@
;(function () {
'use strict';
addAnchors('.bs-docs-section > h1, .bs-docs-section > h2, .bs-docs-section > h3, .bs-docs-section > h4, .bs-docs-section > h5');
addAnchors('.bs-docs-section > h1, .bs-docs-section > h2, .bs-docs-section > h3, .bs-docs-section > h4, .bs-docs-section > h5')
})();