Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
f5f04ae4
Commit
f5f04ae4
authored
11 years ago
by
fat
Browse files
Options
Download
Email Patches
Plain Diff
fix affix…
parent
124d7e62
2 merge requests
!8635
ignore Gruntfile.js in jekyll
,
!8656
Added rel="stylesheet" to CDN-Examples
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
assets/css/docs.css
+14
-4
assets/css/docs.css
assets/js/application.js
+14
-3
assets/js/application.js
dist/js/bootstrap.js
+8
-2
dist/js/bootstrap.js
dist/js/bootstrap.min.js
+1
-1
dist/js/bootstrap.min.js
js/affix.js
+8
-2
js/affix.js
with
45 additions
and
12 deletions
+45
-12
assets/css/docs.css
+
14
-
4
View file @
f5f04ae4
...
@@ -737,7 +737,6 @@ input.focused {
...
@@ -737,7 +737,6 @@ input.focused {
right
:
15px
;
right
:
15px
;
bottom
:
15px
;
bottom
:
15px
;
}
}
.bs-header
{
.bs-header
{
font-size
:
21px
;
font-size
:
21px
;
text-align
:
left
;
text-align
:
left
;
...
@@ -793,12 +792,22 @@ input.focused {
...
@@ -793,12 +792,22 @@ input.focused {
@media
screen
and
(
min-width
:
992px
)
{
@media
screen
and
(
min-width
:
992px
)
{
/* Widen the fixed sidebar */
/* Widen the fixed sidebar */
.bs-sidebar.affix
,
.bs-sidebar.affix-bottom
{
width
:
213px
;
}
.bs-sidebar.affix
{
.bs-sidebar.affix
{
position
:
fixed
;
/* Undo the static from mobile-first approach */
position
:
fixed
;
/* Undo the static from mobile-first approach */
top
:
50px
;
top
:
80px
;
width
:
213px
;
}
.bs-sidebar.affix-bottom
{
position
:
absolute
;
/* Undo the static from mobile-first approach */
}
.bs-sidebar.affix-bottom
.bs-sidenav
,
.bs-sidebar.affix
.bs-sidenav
{
margin-top
:
0
;
margin-bottom
:
0
;
}
}
.bs-header
h1
,
.bs-header
h1
,
.bs-header
p
{
.bs-header
p
{
margin-right
:
380px
;
margin-right
:
380px
;
...
@@ -818,6 +827,7 @@ input.focused {
...
@@ -818,6 +827,7 @@ input.focused {
@media
screen
and
(
min-width
:
1200px
)
{
@media
screen
and
(
min-width
:
1200px
)
{
/* Widen the fixed sidebar again */
/* Widen the fixed sidebar again */
.bs-sidebar.affix-bottom
,
.bs-sidebar.affix
{
.bs-sidebar.affix
{
width
:
270px
;
width
:
270px
;
}
}
...
...
This diff is collapsed.
Click to expand it.
assets/js/application.js
+
14
-
3
View file @
f5f04ae4
...
@@ -13,12 +13,23 @@
...
@@ -13,12 +13,23 @@
e
.
preventDefault
()
e
.
preventDefault
()
})
})
// back to top
// back to top
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'
.bs-sidebar
'
).
affix
({
var
$sideBar
=
$
(
'
.bs-sidebar
'
)
$sideBar
.
affix
({
offset
:
{
offset
:
{
top
:
function
()
{
return
$window
.
width
()
<=
980
?
290
:
210
}
top
:
function
()
{
,
bottom
:
270
var
offsetTop
=
$sideBar
.
offset
().
top
var
sideBarMargin
=
parseInt
(
$sideBar
.
children
(
0
).
css
(
'
margin-top
'
),
10
)
var
navOuterHeight
=
$
(
'
.bs-docs-nav
'
).
height
()
return
(
this
.
top
=
offsetTop
-
navOuterHeight
-
sideBarMargin
)
}
,
bottom
:
function
()
{
return
(
this
.
bottom
=
$
(
'
.bs-footer
'
).
outerHeight
(
true
))
}
}
}
})
})
},
100
)
},
100
)
...
...
This diff is collapsed.
Click to expand it.
dist/js/bootstrap.js
+
8
-
2
View file @
f5f04ae4
...
@@ -1842,6 +1842,8 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
...
@@ -1842,6 +1842,8 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
this
.
checkPosition
()
this
.
checkPosition
()
}
}
Affix
.
RESET
=
'
affix affix-top affix-bottom
'
Affix
.
DEFAULTS
=
{
Affix
.
DEFAULTS
=
{
offset
:
0
offset
:
0
}
}
...
@@ -1859,7 +1861,6 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
...
@@ -1859,7 +1861,6 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
var
offset
=
this
.
options
.
offset
var
offset
=
this
.
options
.
offset
var
offsetTop
=
offset
.
top
var
offsetTop
=
offset
.
top
var
offsetBottom
=
offset
.
bottom
var
offsetBottom
=
offset
.
bottom
var
reset
=
'
affix affix-top affix-bottom
'
if
(
typeof
offset
!=
'
object
'
)
offsetBottom
=
offsetTop
=
offset
if
(
typeof
offset
!=
'
object
'
)
offsetBottom
=
offsetTop
=
offset
if
(
typeof
offsetTop
==
'
function
'
)
offsetTop
=
offset
.
top
()
if
(
typeof
offsetTop
==
'
function
'
)
offsetTop
=
offset
.
top
()
...
@@ -1870,11 +1871,16 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
...
@@ -1870,11 +1871,16 @@ if (!jQuery) throw new Error("Bootstrap requires jQuery")
offsetTop
!=
null
&&
(
scrollTop
<=
offsetTop
)
?
'
top
'
:
false
offsetTop
!=
null
&&
(
scrollTop
<=
offsetTop
)
?
'
top
'
:
false
if
(
this
.
affixed
===
affix
)
return
if
(
this
.
affixed
===
affix
)
return
if
(
this
.
unpin
)
this
.
$element
.
css
(
'
top
'
,
''
)
this
.
affixed
=
affix
this
.
affixed
=
affix
this
.
unpin
=
affix
==
'
bottom
'
?
position
.
top
-
scrollTop
:
null
this
.
unpin
=
affix
==
'
bottom
'
?
position
.
top
-
scrollTop
:
null
this
.
$element
.
removeClass
(
reset
).
addClass
(
'
affix
'
+
(
affix
?
'
-
'
+
affix
:
''
))
this
.
$element
.
removeClass
(
Affix
.
RESET
).
addClass
(
'
affix
'
+
(
affix
?
'
-
'
+
affix
:
''
))
if
(
affix
==
'
bottom
'
)
{
this
.
$element
.
offset
({
top
:
document
.
body
.
offsetHeight
-
offsetBottom
-
this
.
$element
.
height
()
})
}
}
}
...
...
This diff is collapsed.
Click to expand it.
dist/js/bootstrap.min.js
+
1
-
1
View file @
f5f04ae4
This diff is collapsed.
Click to expand it.
js/affix.js
+
8
-
2
View file @
f5f04ae4
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
this
.
checkPosition
()
this
.
checkPosition
()
}
}
Affix
.
RESET
=
'
affix affix-top affix-bottom
'
Affix
.
DEFAULTS
=
{
Affix
.
DEFAULTS
=
{
offset
:
0
offset
:
0
}
}
...
@@ -53,7 +55,6 @@
...
@@ -53,7 +55,6 @@
var
offset
=
this
.
options
.
offset
var
offset
=
this
.
options
.
offset
var
offsetTop
=
offset
.
top
var
offsetTop
=
offset
.
top
var
offsetBottom
=
offset
.
bottom
var
offsetBottom
=
offset
.
bottom
var
reset
=
'
affix affix-top affix-bottom
'
if
(
typeof
offset
!=
'
object
'
)
offsetBottom
=
offsetTop
=
offset
if
(
typeof
offset
!=
'
object
'
)
offsetBottom
=
offsetTop
=
offset
if
(
typeof
offsetTop
==
'
function
'
)
offsetTop
=
offset
.
top
()
if
(
typeof
offsetTop
==
'
function
'
)
offsetTop
=
offset
.
top
()
...
@@ -64,11 +65,16 @@
...
@@ -64,11 +65,16 @@
offsetTop
!=
null
&&
(
scrollTop
<=
offsetTop
)
?
'
top
'
:
false
offsetTop
!=
null
&&
(
scrollTop
<=
offsetTop
)
?
'
top
'
:
false
if
(
this
.
affixed
===
affix
)
return
if
(
this
.
affixed
===
affix
)
return
if
(
this
.
unpin
)
this
.
$element
.
css
(
'
top
'
,
''
)
this
.
affixed
=
affix
this
.
affixed
=
affix
this
.
unpin
=
affix
==
'
bottom
'
?
position
.
top
-
scrollTop
:
null
this
.
unpin
=
affix
==
'
bottom
'
?
position
.
top
-
scrollTop
:
null
this
.
$element
.
removeClass
(
reset
).
addClass
(
'
affix
'
+
(
affix
?
'
-
'
+
affix
:
''
))
this
.
$element
.
removeClass
(
Affix
.
RESET
).
addClass
(
'
affix
'
+
(
affix
?
'
-
'
+
affix
:
''
))
if
(
affix
==
'
bottom
'
)
{
this
.
$element
.
offset
({
top
:
document
.
body
.
offsetHeight
-
offsetBottom
-
this
.
$element
.
height
()
})
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets