1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 10:46:32 +00:00

fix styling

This commit is contained in:
Baptiste Augrain
2018-09-08 18:14:41 +02:00
parent 2da1105ff8
commit 2706df2b24
3 changed files with 15 additions and 6 deletions

View File

@@ -133,8 +133,8 @@ body[data-theme="dark"]
content: "\25B8" content: "\25B8"
.CodeMirror-hover .CodeMirror-hover
padding 2px 4px 0 4px
position absolute position absolute
border-bottom 1px solid white
z-index 99 z-index 99
.CodeMirror-hyperlink .CodeMirror-hyperlink

View File

@@ -26,7 +26,7 @@
this.tooltip = document.createElement('div') this.tooltip = document.createElement('div')
this.tooltipContent = document.createElement('div') this.tooltipContent = document.createElement('div')
this.tooltipIndicator = document.createElement('div') this.tooltipIndicator = document.createElement('div')
this.tooltip.setAttribute('class', 'CodeMirror-hover') this.tooltip.setAttribute('class', 'CodeMirror-hover CodeMirror-matchingbracket CodeMirror-selected')
this.tooltip.setAttribute('cm-ignore-events', 'true') this.tooltip.setAttribute('cm-ignore-events', 'true')
this.tooltip.appendChild(this.tooltipContent) this.tooltip.appendChild(this.tooltipContent)
this.tooltip.appendChild(this.tooltipIndicator) this.tooltip.appendChild(this.tooltipIndicator)
@@ -67,7 +67,10 @@
const url = this.getUrl(target) const url = this.getUrl(target)
if (url) { if (url) {
if (metaKey) { if (metaKey) {
target.classList.add('CodeMirror-hyperlink') target.classList.add('CodeMirror-activeline-background', 'CodeMirror-hyperlink')
}
else {
target.classList.add('CodeMirror-activeline-background')
} }
this.showInfo(target) this.showInfo(target)
@@ -75,7 +78,7 @@
} }
onMouseLeave(e) { onMouseLeave(e) {
if (this.tooltip.parentElement === this.lineDiv) { if (this.tooltip.parentElement === this.lineDiv) {
e.target.classList.remove('CodeMirror-hyperlink') e.target.classList.remove('CodeMirror-activeline-background', 'CodeMirror-hyperlink')
this.lineDiv.removeChild(this.tooltip) this.lineDiv.removeChild(this.tooltip)
} }
@@ -104,7 +107,13 @@
xOffset = b3.right - b2.right xOffset = b3.right - b2.right
tdiv.style.left = (b1.left - b2.left - xOffset) + 'px' tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
} }
tdiv.style.top = (b1.top - b2.top - b3.height - this.yOffset) + 'px' const top = b1.top - b2.top - b3.height - this.yOffset
if (top < 0) {
tdiv.style.top = (b1.top - b2.top + b1.height + this.yOffset) + 'px'
}
else {
tdiv.style.top = top + 'px'
}
this.tooltipIndicator.style.marginLeft = xOffset + 'px' this.tooltipIndicator.style.marginLeft = xOffset + 'px'
} }

View File

@@ -96,7 +96,7 @@
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script> <script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
<script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script> <script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script>
<script src="../browser/codemirror/addon/hyperlink/hyperlink.js"></script> <script src="../extra_scripts/codemirror/addon/hyperlink/hyperlink.js"></script>
<script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script> <script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script>
<script src="../node_modules/codemirror/addon/edit/matchbrackets.js"></script> <script src="../node_modules/codemirror/addon/edit/matchbrackets.js"></script>