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

fix up customizer js and classes; turn buttons into real buttons

This commit is contained in:
Mark Otto
2013-05-22 23:34:28 -07:00
parent 432d417ade
commit acc0875259
3 changed files with 29 additions and 25 deletions

View File

@@ -27,13 +27,6 @@
$('.bs-top').affix()
}, 100)
// add-ons
$('.add-on :checkbox').on('click', function () {
var $this = $(this)
, method = $this.attr('checked') ? 'addClass' : 'removeClass'
$(this).parents('.add-on')[method]('active')
})
// add tipsies to grid for scaffolding
if ($('#grid-system').length) {
$('#grid-system').tooltip({
@@ -76,22 +69,22 @@
$('.bs-docs-carousel-example').carousel()
// javascript build logic
var inputsComponent = $("#components.download input")
, inputsPlugin = $("#plugins.download input")
, inputsVariables = $("#variables.download input")
var inputsComponent = $("#components input")
, inputsPlugin = $("#plugins input")
, inputsVariables = $("#variables input")
// toggle all plugin checkboxes
$('#components.download .toggle-all').on('click', function (e) {
$('#components .toggle').on('click', function (e) {
e.preventDefault()
inputsComponent.attr('checked', !inputsComponent.is(':checked'))
inputsComponent.prop('checked', !inputsComponent.is(':checked'))
})
$('#plugins.download .toggle-all').on('click', function (e) {
$('#plugins .toggle').on('click', function (e) {
e.preventDefault()
inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
inputsPlugin.prop('checked', !inputsPlugin.is(':checked'))
})
$('#variables.download .toggle-all').on('click', function (e) {
$('#variables .toggle').on('click', function (e) {
e.preventDefault()
inputsVariables.val('')
})
@@ -99,16 +92,16 @@
// request built javascript
$('.download-btn .btn').on('click', function () {
var css = $("#components.download input:checked")
var css = $("#components input:checked")
.map(function () { return this.value })
.toArray()
, js = $("#plugins.download input:checked")
, js = $("#plugins input:checked")
.map(function () { return this.value })
.toArray()
, vars = {}
, img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
$("#variables.download input")
$("#variables input")
.each(function () {
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
})