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
ae0d4805
Commit
ae0d4805
authored
Dec 08, 2013
by
Chris Rebert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #11787: document stateful button JS
parent
1f35b6ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
docs-assets/js/application.js
docs-assets/js/application.js
+1
-1
javascript.html
javascript.html
+21
-3
No files found.
docs-assets/js/application.js
View file @
ae0d4805
...
...
@@ -90,7 +90,7 @@
.
popover
()
// button state demo
$
(
'
#
fat
-btn
'
)
$
(
'
#
loading-example
-btn
'
)
.
click
(
function
()
{
var
btn
=
$
(
this
)
btn
.
button
(
'
loading
'
)
...
...
javascript.html
View file @
ae0d4805
...
...
@@ -1334,14 +1334,23 @@ $('#my-alert').bind('closed.bs.alert', function () {
<h4>
Stateful
</h4>
<p>
Add
<code>
data-loading-text="Loading..."
</code>
to use a loading state on a button.
</p>
<div
class=
"bs-example"
style=
"padding-bottom: 24px;"
>
<button
type=
"button"
id=
"
fat
-btn"
data-loading-text=
"Loading..."
class=
"btn btn-primary"
>
<button
type=
"button"
id=
"
loading-example
-btn"
data-loading-text=
"Loading..."
class=
"btn btn-primary"
>
Loading state
</button>
</div>
<!-- /example -->
{% highlight html %}
<button
type=
"button"
data-loading-text=
"Loading..."
class=
"btn btn-primary"
>
<button
type=
"button"
id=
"loading-example-btn"
data-loading-text=
"Loading..."
class=
"btn btn-primary"
>
Loading state
</button>
<script>
$
(
'
#loading-example-btn
'
).
click
(
function
()
{
var
btn
=
$
(
this
);
btn
.
button
(
'
loading
'
);
$
.
ajax
(...).
always
(
function
()
{
btn
.
button
(
'
reset
'
);
});
});
</script>
{% endhighlight %}
<h4>
Single toggle
</h4>
...
...
@@ -1440,7 +1449,16 @@ $('.btn').button()
<p>
Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute
<code>
data-loading-text
</code>
.
</p>
{% highlight html %}
<button
type=
"button"
class=
"btn btn-primary"
data-loading-text=
"loading stuff..."
>
...
</button>
<button
id=
"loading-example-btn"
type=
"button"
class=
"btn btn-primary"
data-loading-text=
"loading stuff..."
>
...
</button>
<script>
$
(
'
#loading-example-btn
'
).
click
(
function
()
{
var
btn
=
$
(
this
);
btn
.
button
(
'
loading
'
);
$
.
ajax
(...).
always
(
function
()
{
btn
.
button
(
'
reset
'
);
});
});
</script>
{% endhighlight %}
<div
class=
"bs-callout bs-callout-danger"
>
...
...
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