Simplifie
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
8535a11dd2
commit
072cbe98b5
1 changed files with 2 additions and 3 deletions
|
@ -100,7 +100,7 @@ export default class TextualBody extends React.Component {
|
||||||
const div = this._wrapInDiv(pres[i]);
|
const div = this._wrapInDiv(pres[i]);
|
||||||
this._handleCodeBlockExpansion(pres[i]);
|
this._handleCodeBlockExpansion(pres[i]);
|
||||||
this._addCodeCopyButton(div);
|
this._addCodeCopyButton(div);
|
||||||
this._addCodeExpansionButton(div);
|
this._addCodeExpansionButton(div, pres[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Highlight code
|
// Highlight code
|
||||||
|
@ -120,10 +120,9 @@ export default class TextualBody extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_addCodeExpansionButton(div) {
|
_addCodeExpansionButton(div, pre) {
|
||||||
// TODO: What if the block is small and the we don't need the icon?
|
// TODO: What if the block is small and the we don't need the icon?
|
||||||
|
|
||||||
const pre = div.getElementsByTagName("pre")[0];
|
|
||||||
const button = document.createElement("span");
|
const button = document.createElement("span");
|
||||||
if (pre.className == "mx_EventTile_collapsedCodeBlock") {
|
if (pre.className == "mx_EventTile_collapsedCodeBlock") {
|
||||||
button.className = "mx_EventTile_expandButton";
|
button.className = "mx_EventTile_expandButton";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue