aboutsummaryrefslogtreecommitdiff
path: root/docs/assets/js/src/application.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2015-04-29 12:11:58 +0300
committerXhmikosR <[email protected]>2015-05-05 06:50:18 +0300
commit49c45563546af97eaab0c6f083d68fbc3b4a0ce6 (patch)
tree282625ff1f31bf0441821254a61d2313786ae20b /docs/assets/js/src/application.js
parent93785be2c689a38f134e201feb753faf782fffa2 (diff)
downloadbootstrap-49c45563546af97eaab0c6f083d68fbc3b4a0ce6.tar.xz
bootstrap-49c45563546af97eaab0c6f083d68fbc3b4a0ce6.zip
Comply to the new JSCS rules.
Diffstat (limited to 'docs/assets/js/src/application.js')
-rw-r--r--docs/assets/js/src/application.js41
1 files changed, 21 insertions, 20 deletions
diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js
index 56528367c..35f39f6f0 100644
--- a/docs/assets/js/src/application.js
+++ b/docs/assets/js/src/application.js
@@ -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')
})();