Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
d21369c1
Commit
d21369c1
authored
Dec 26, 2013
by
fat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #10890
parent
cd0ad94a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
30 deletions
+34
-30
dist/js/bootstrap.js
dist/js/bootstrap.js
+16
-14
dist/js/bootstrap.min.js
dist/js/bootstrap.min.js
+1
-1
docs-assets/js/raw-files.js
docs-assets/js/raw-files.js
+1
-1
js/button.js
js/button.js
+16
-14
No files found.
dist/js/bootstrap.js
View file @
d21369c1
...
...
@@ -157,8 +157,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
// ==============================
var
Button
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
Button
.
DEFAULTS
,
options
)
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
Button
.
DEFAULTS
,
options
)
this
.
isLoading
=
false
}
Button
.
DEFAULTS
=
{
...
...
@@ -178,25 +179,26 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$el
[
val
](
data
[
state
]
||
this
.
options
[
state
])
// push to event loop to allow forms to submit
setTimeout
(
function
()
{
state
==
'
loadingText
'
?
$el
.
addClass
(
d
).
attr
(
d
,
d
)
:
$el
.
removeClass
(
d
).
removeAttr
(
d
);
},
0
)
setTimeout
(
$
.
proxy
(
function
()
{
if
(
state
==
'
loadingText
'
)
{
this
.
isLoading
=
true
$el
.
addClass
(
d
).
attr
(
d
,
d
)
}
else
if
(
this
.
isLoading
)
{
this
.
isLoading
=
false
$el
.
removeClass
(
d
).
removeAttr
(
d
)
}
},
this
),
0
)
}
Button
.
prototype
.
toggle
=
function
()
{
var
$parent
=
this
.
$element
.
closest
(
'
[data-toggle="buttons"]
'
)
var
changed
=
true
var
$parent
=
this
.
$element
.
closest
(
'
[data-toggle="buttons"]
'
)
if
(
$parent
.
length
)
{
var
$input
=
this
.
$element
.
find
(
'
input
'
)
if
(
$input
.
prop
(
'
type
'
)
===
'
radio
'
)
{
// see if clicking on current one
if
(
$input
.
prop
(
'
checked
'
)
&&
this
.
$element
.
hasClass
(
'
active
'
))
changed
=
false
else
$parent
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
if
(
$input
.
prop
(
'
type
'
)
==
'
radio
'
)
{
if
(
$input
.
prop
(
'
checked
'
)
&&
this
.
$element
.
hasClass
(
'
active
'
))
changed
=
false
else
$parent
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
}
if
(
changed
)
$input
.
prop
(
'
checked
'
,
!
this
.
$element
.
hasClass
(
'
active
'
)).
trigger
(
'
change
'
)
}
...
...
dist/js/bootstrap.min.js
View file @
d21369c1
This diff is collapsed.
Click to expand it.
docs-assets/js/raw-files.js
View file @
d21369c1
This diff is collapsed.
Click to expand it.
js/button.js
View file @
d21369c1
...
...
@@ -13,8 +13,9 @@
// ==============================
var
Button
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
Button
.
DEFAULTS
,
options
)
this
.
$element
=
$
(
element
)
this
.
options
=
$
.
extend
({},
Button
.
DEFAULTS
,
options
)
this
.
isLoading
=
false
}
Button
.
DEFAULTS
=
{
...
...
@@ -34,25 +35,26 @@
$el
[
val
](
data
[
state
]
||
this
.
options
[
state
])
// push to event loop to allow forms to submit
setTimeout
(
function
()
{
state
==
'
loadingText
'
?
$el
.
addClass
(
d
).
attr
(
d
,
d
)
:
$el
.
removeClass
(
d
).
removeAttr
(
d
);
},
0
)
setTimeout
(
$
.
proxy
(
function
()
{
if
(
state
==
'
loadingText
'
)
{
this
.
isLoading
=
true
$el
.
addClass
(
d
).
attr
(
d
,
d
)
}
else
if
(
this
.
isLoading
)
{
this
.
isLoading
=
false
$el
.
removeClass
(
d
).
removeAttr
(
d
)
}
},
this
),
0
)
}
Button
.
prototype
.
toggle
=
function
()
{
var
$parent
=
this
.
$element
.
closest
(
'
[data-toggle="buttons"]
'
)
var
changed
=
true
var
$parent
=
this
.
$element
.
closest
(
'
[data-toggle="buttons"]
'
)
if
(
$parent
.
length
)
{
var
$input
=
this
.
$element
.
find
(
'
input
'
)
if
(
$input
.
prop
(
'
type
'
)
===
'
radio
'
)
{
// see if clicking on current one
if
(
$input
.
prop
(
'
checked
'
)
&&
this
.
$element
.
hasClass
(
'
active
'
))
changed
=
false
else
$parent
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
if
(
$input
.
prop
(
'
type
'
)
==
'
radio
'
)
{
if
(
$input
.
prop
(
'
checked
'
)
&&
this
.
$element
.
hasClass
(
'
active
'
))
changed
=
false
else
$parent
.
find
(
'
.active
'
).
removeClass
(
'
active
'
)
}
if
(
changed
)
$input
.
prop
(
'
checked
'
,
!
this
.
$element
.
hasClass
(
'
active
'
)).
trigger
(
'
change
'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment