mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
ui: change a bit the architecture of sidediv line number
So we can easily customize with plugins, such as ep_author_neat
This commit is contained in:
parent
a522db3ef4
commit
9587c1c673
3 changed files with 10 additions and 10 deletions
|
@ -106,12 +106,12 @@ body.doesWrap:not(.noprewrap) > div {
|
|||
#sidediv:not(.sidedivdelayed) { /* before sidediv get initialized, hide text */
|
||||
color: transparent;
|
||||
}
|
||||
#sidediv.sidedivhidden {
|
||||
/* Do not use display: none to hide the sidediv, otherwise the parent container does not
|
||||
get its height properly calculated by flexboxes */
|
||||
visibility: hidden;
|
||||
width: 0;
|
||||
padding: 0;
|
||||
.line-numbers-hidden #sidediv .line-number {
|
||||
display: none;
|
||||
}
|
||||
#sidediv:not(.authorColors) #sidedivinner>div:before {
|
||||
content: none !important;
|
||||
}
|
||||
}
|
||||
#linemetricsdiv {
|
||||
position: absolute;
|
||||
|
|
|
@ -956,8 +956,7 @@ function Ace2Inner(){
|
|||
showsuserselections: setClassPresenceNamed(root, "userSelections"),
|
||||
showslinenumbers : function(value){
|
||||
hasLineNumbers = !! value;
|
||||
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
|
||||
setClassPresence(sideDiv.parentNode, "sidediv-hidden", !hasLineNumbers);
|
||||
setClassPresence(sideDiv.parentNode, "line-numbers-hidden", !hasLineNumbers);
|
||||
fixView();
|
||||
},
|
||||
grayedout: setClassPresenceNamed(outerWin.document.body, "grayedout"),
|
||||
|
@ -5275,7 +5274,7 @@ function Ace2Inner(){
|
|||
function initLineNumbers()
|
||||
{
|
||||
lineNumbersShown = 1;
|
||||
sideDiv.innerHTML = '<div id="sidedivinner" class="sidedivinner"><div>1</div></div>';
|
||||
sideDiv.innerHTML = '<div id="sidedivinner" class="sidedivinner"><div><span class="line-number">1</span></div></div>';
|
||||
sideDivInner = outerWin.document.getElementById("sidedivinner");
|
||||
$(sideDiv).addClass("sidediv");
|
||||
}
|
||||
|
@ -5352,7 +5351,7 @@ function Ace2Inner(){
|
|||
div.style.height = h +"px";
|
||||
}
|
||||
|
||||
div.appendChild(odoc.createTextNode(String(n)));
|
||||
$(div).append($("<span class='line-number'>" + String(n) + "</span>"));
|
||||
fragment.appendChild(div);
|
||||
if(b){
|
||||
b = b.nextSibling;
|
||||
|
|
|
@ -135,6 +135,7 @@ var padeditor = (function()
|
|||
v = getOption('showAuthorColors', true);
|
||||
self.ace.setProperty("showsauthorcolors", v);
|
||||
$('#chattext').toggleClass('authorColors', v);
|
||||
$('iframe[name="ace_outer"]').contents().find('#sidedivinner').toggleClass('authorColors', v);
|
||||
padutils.setCheckbox($("#options-colorscheck"), v);
|
||||
|
||||
// Override from parameters if true
|
||||
|
|
Loading…
Reference in a new issue