Merge branch 'master' into font
This commit is contained in:
commit
9199009665
28
edit/tab.css
28
edit/tab.css
|
@ -1,28 +0,0 @@
|
|||
.tab-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid silver;
|
||||
padding: 5px 5px 0 15px;
|
||||
}
|
||||
.tab-bar-item {
|
||||
margin: 0 0.3em;
|
||||
padding: 0.3em 0.6em;
|
||||
border: 1px solid silver;
|
||||
border-bottom: none;
|
||||
background: silver;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tab-bar-item.active {
|
||||
background: white;
|
||||
}
|
||||
.tab-panel {
|
||||
flex-grow: 1;
|
||||
}
|
||||
.tab-panel > :not(.active) {
|
||||
display: none;
|
||||
}
|
||||
|
19
edit/tab.js
19
edit/tab.js
|
@ -1,19 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
(() => {
|
||||
for (const container of document.querySelectorAll('.tab-container')) {
|
||||
init(container);
|
||||
}
|
||||
|
||||
function init(container) {
|
||||
const tabButtons = [...container.querySelector('.tab-bar').children];
|
||||
const tabPanels = [...container.querySelector('.tab-panel').children];
|
||||
tabButtons.forEach((button, i) => button.addEventListener('click', () => activate(i)));
|
||||
|
||||
function activate(index) {
|
||||
const toggleActive = (button, i) => button.classList.toggle('active', i === index);
|
||||
tabButtons.forEach(toggleActive);
|
||||
tabPanels.forEach(toggleActive);
|
||||
}
|
||||
}
|
||||
})();
|
|
@ -4381,18 +4381,10 @@ self.parserlib = (() => {
|
|||
let next, tt;
|
||||
while ((next = stream.get(true)).value !== '}' && (tt = next.type)) {
|
||||
try {
|
||||
// Pre-check to avoid calling _ws too much as it's wasteful
|
||||
if (tt === Tokens.S ||
|
||||
tt === Tokens.COMMENT ||
|
||||
tt === Tokens.USO_VAR) {
|
||||
this._ws(next, true);
|
||||
tt = 0;
|
||||
}
|
||||
if (tt === Tokens.SEMICOLON ||
|
||||
this._ws(next, true) ||
|
||||
readMargins && this._margin() ||
|
||||
(tt && stream.unget(), this._declaration(true, Props)) ||
|
||||
(next = stream.LT(1)).value === ';' ||
|
||||
this._ws(null, true)) {
|
||||
(stream.unget(), this._declaration(true, Props))) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
@ -4427,6 +4419,14 @@ self.parserlib = (() => {
|
|||
}
|
||||
|
||||
_ws(start, skipUsoVar) {
|
||||
const tt = start && start.type;
|
||||
if (tt && !(
|
||||
tt === Tokens.S ||
|
||||
tt === Tokens.COMMENT ||
|
||||
tt === Tokens.USO_VAR && skipUsoVar
|
||||
)) {
|
||||
return '';
|
||||
}
|
||||
const stream = this._tokenStream;
|
||||
const tokens = skipUsoVar ? TT.usoS : Tokens.S;
|
||||
let ws = start ? start.value : '';
|
||||
|
|
Loading…
Reference in New Issue
Block a user