[IMP] ws doc: affix language switcher to page top
This commit is contained in:
parent
39d77f9e85
commit
8e9c23235a
|
@ -77,7 +77,7 @@ $(function () {
|
||||||
var sheet = findSheet(/style\.css$/);
|
var sheet = findSheet(/style\.css$/);
|
||||||
if (!sheet) { return; }
|
if (!sheet) { return; }
|
||||||
// build PL switcher UI and hook toggle event
|
// build PL switcher UI and hook toggle event
|
||||||
$(buildSwitcher(Object.keys(languages)))
|
var $switcher = $(buildSwitcher(Object.keys(languages)))
|
||||||
.prependTo('div.documentwrapper')
|
.prependTo('div.documentwrapper')
|
||||||
.on('click', 'li', function (e) {
|
.on('click', 'li', function (e) {
|
||||||
$(e.target).addClass('active')
|
$(e.target).addClass('active')
|
||||||
|
@ -93,7 +93,8 @@ $(function () {
|
||||||
].join('');
|
].join('');
|
||||||
sheet.deleteRule(lastIndex);
|
sheet.deleteRule(lastIndex);
|
||||||
sheet.insertRule(sel + '{' + content + '}', lastIndex);
|
sheet.insertRule(sel + '{' + content + '}', lastIndex);
|
||||||
});
|
});
|
||||||
|
$switcher.affix();
|
||||||
})(); }
|
})(); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7248,7 +7248,7 @@ td.field-body > ul {
|
||||||
color: white;
|
color: white;
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
float: none !important;
|
float: none !important;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
-webkit-justify-content: flex-end;
|
-webkit-justify-content: flex-end;
|
||||||
|
@ -7259,6 +7259,10 @@ td.field-body > ul {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
.stripe .switcher.affix {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
.stripe .switcher li {
|
.stripe .switcher li {
|
||||||
background-color: #0f131a;
|
background-color: #0f131a;
|
||||||
padding: 0.4em 1em;
|
padding: 0.4em 1em;
|
||||||
|
@ -7268,10 +7272,10 @@ td.field-body > ul {
|
||||||
}
|
}
|
||||||
.stripe .switcher li:first-child {
|
.stripe .switcher li:first-child {
|
||||||
border-left-width: 1px;
|
border-left-width: 1px;
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 0 0 0 5px;
|
||||||
}
|
}
|
||||||
.stripe .switcher li:last-child {
|
.stripe .switcher li:last-child {
|
||||||
border-radius: 0 5px 5px 0;
|
border-radius: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
.stripe .switcher li:hover {
|
.stripe .switcher li:hover {
|
||||||
background-color: #222;
|
background-color: #222;
|
||||||
|
|
|
@ -767,7 +767,7 @@ td.field-body {
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
float: none !important;
|
float: none !important;
|
||||||
|
|
||||||
position: fixed;
|
position: absolute;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
-webkit-justify-content: flex-end;
|
-webkit-justify-content: flex-end;
|
||||||
|
@ -778,6 +778,10 @@ td.field-body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
|
&.affix {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
background-color: #0f131a;
|
background-color: #0f131a;
|
||||||
|
@ -787,10 +791,10 @@ td.field-body {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-left-width: 1px;
|
border-left-width: 1px;
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 0 0 0 5px;
|
||||||
}
|
}
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-radius: 0 5px 5px 0;
|
border-radius: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #222;
|
background-color: #222;
|
||||||
|
|
Loading…
Reference in New Issue