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
69372701
Commit
69372701
authored
Nov 24, 2011
by
Jacob Thornton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor dropdown in accordance with readme
parent
71654cbf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
89 deletions
+65
-89
js/bootstrap-accordion.js
js/bootstrap-accordion.js
+0
-41
js/bootstrap-alerts.js
js/bootstrap-alerts.js
+3
-4
js/bootstrap-buttons.js
js/bootstrap-buttons.js
+36
-25
js/bootstrap-dropdown.js
js/bootstrap-dropdown.js
+26
-19
No files found.
js/bootstrap-accordion.js
deleted
100644 → 0
View file @
71654cbf
/* =============================================================
* bootstrap-accordion.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#accordion
* =============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
(
function
(
$
){
var
Accordion
=
function
(
element
,
options
)
{}
Accordion
.
prototype
=
{}
/* ALERT PLUGIN DEFINITION
* ======================= */
$
.
fn
.
accordion
=
function
(
options
)
{
if
(
options
===
true
)
{
return
this
.
data
(
'
accordion
'
)
}
return
this
.
each
(
function
()
{
new
Accordion
(
this
,
options
)
})
}
})(
window
.
jQuery
||
window
.
ender
)
\ No newline at end of file
js/bootstrap-alerts.js
View file @
69372701
...
...
@@ -26,7 +26,7 @@
* ====================== */
var
dismiss
=
'
[data-dismiss="alert"]
'
,
Alert
=
function
(
el
,
close
)
{
,
Alert
=
function
(
el
)
{
$
(
el
).
delegate
(
dismiss
,
'
click
'
,
this
.
close
)
}
...
...
@@ -36,7 +36,6 @@
var
$element
=
$
(
this
)
$element
=
$element
.
hasClass
(
'
alert-message
'
)
?
$element
:
$element
.
parent
()
e
&&
e
.
preventDefault
()
$element
.
removeClass
(
'
in
'
)
...
...
@@ -55,12 +54,12 @@
/* ALERT PLUGIN DEFINITION
* ======================= */
$
.
fn
.
alert
=
function
(
option
s
)
{
$
.
fn
.
alert
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
alert
'
)
if
(
!
data
)
$this
.
data
(
'
alert
'
,
(
data
=
new
Alert
(
this
)))
if
(
typeof
option
s
==
'
string
'
)
data
[
options
].
call
(
$this
)
if
(
typeof
option
==
'
string
'
)
data
[
option
].
call
(
$this
)
})
}
...
...
js/bootstrap-buttons.js
View file @
69372701
...
...
@@ -24,19 +24,25 @@
/* BUTTON PUBLIC CLASS DEFINITION
* ============================== */
var
Button
var
Button
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
)
this
.
settings
=
$
.
extend
({},
$
.
fn
.
button
.
defaults
,
options
)
}
Button
.
prototype
=
{
function
setState
(
el
,
state
)
{
setState
:
function
(
state
)
{
var
d
=
'
disabled
'
,
$el
=
$
(
el
)
,
$el
=
this
.
$element
,
data
=
$el
.
data
()
,
val
=
$el
.
is
(
'
input
'
)
?
'
val
'
:
'
html
'
state
=
state
+
'
Text
'
data
.
resetText
||
$el
.
data
(
'
resetText
'
,
$el
[
val
]())
$el
[
val
](
data
[
state
]
||
$
.
fn
.
button
.
defaults
[
state
]
)
$el
[
val
](
data
[
state
]
||
this
.
settings
[
state
]
)
// push to event loop to allow forms to submit
setTimeout
(
function
()
{
state
==
'
loadingText
'
?
$el
.
addClass
(
d
).
attr
(
d
,
d
)
:
...
...
@@ -44,25 +50,30 @@
},
0
)
}
function
toggle
(
el
)
{
var
$el
=
$
(
el
)
,
$parent
=
$el
.
parent
(
'
[data-toggle="buttons-radio"]
'
)
,
toggle
:
function
()
{
var
$parent
=
this
.
$element
.
parent
(
'
[data-toggle="buttons-radio"]
'
)
$parent
&&
$parent
.
find
(
'
.active
'
)
.
removeClass
(
'
active
'
)
$el
.
toggleClass
(
'
active
'
)
this
.
$element
.
toggleClass
(
'
active
'
)
}
}
/* BUTTON PLUGIN DEFINITION
* ======================== */
$
.
fn
.
button
=
function
(
options
)
{
$
.
fn
.
button
=
function
(
option
)
{
return
this
.
each
(
function
()
{
if
(
options
==
'
toggle
'
)
return
toggle
(
this
)
options
&&
setState
(
this
,
options
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
button
'
)
,
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
)
$this
.
data
(
'
button
'
,
(
data
=
new
Button
(
this
,
options
)))
if
(
option
==
'
toggle
'
)
data
.
toggle
()
else
if
(
option
)
data
.
setState
(
option
)
})
}
...
...
js/bootstrap-dropdown.js
View file @
69372701
...
...
@@ -22,16 +22,17 @@
"
use strict
"
/* SIMPLE DROPDOWN LOGIC
*
===================== */
/* DROPDOWN CLASS DEFINITION
* ====
===================== */
var
s
=
'
[data-toggle="dropdown"]
'
function
clearMenus
()
{
$
(
s
).
parent
(
'
li
'
).
removeClass
(
'
open
'
)
var
toggle
=
'
[data-toggle="dropdown"]
'
,
Dropdown
=
function
(
element
)
{
$
(
element
).
bind
(
'
click
'
,
this
.
toggle
)
}
function
toggle
(
e
)
{
Dropdown
.
prototype
=
{
toggle
:
function
(
e
)
{
var
li
=
$
(
this
).
parent
(
'
li
'
)
,
isActive
=
li
.
hasClass
(
'
open
'
)
...
...
@@ -41,16 +42,22 @@
return
false
}
}
function
clearMenus
()
{
$
(
toggle
).
parent
(
'
li
'
).
removeClass
(
'
open
'
)
}
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$
.
fn
.
dropdown
=
function
(
selector
)
{
$
.
fn
.
dropdown
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
args
=
[
'
click
'
,
toggle
]
,
$this
=
$
(
this
)
selector
&&
args
.
unshift
(
selector
)
$this
[
selector
?
'
delegate
'
:
'
bind
'
].
apply
(
$this
,
arg
s
)
var
$this
=
$
(
this
)
,
data
=
$this
.
data
(
'
dropdown
'
)
if
(
!
data
)
$this
.
data
(
'
dropdown
'
,
(
data
=
new
Dropdown
(
this
))
)
if
(
typeof
option
==
'
string
'
)
data
[
option
].
call
(
$thi
s
)
})
}
...
...
@@ -59,8 +66,8 @@
* =================================== */
$
(
function
()
{
$
(
'
html
'
).
bind
(
"
click.dropdown.data-api
"
,
clearMenus
)
$
(
'
body
'
).
d
ropdown
(
s
)
$
(
'
html
'
).
bind
(
'
click.dropdown.data-api
'
,
clearMenus
)
$
(
'
body
'
).
d
elegate
(
toggle
,
'
click.dropdown.data-api
'
,
Dropdown
.
prototype
.
toggle
)
})
}(
window
.
jQuery
||
window
.
ender
);
\ No newline at end of file
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