Inject caret css on mode enter
This commit is contained in:
parent
72040a3bbb
commit
70b58d1928
@ -1070,12 +1070,41 @@ window._qutebrowser.caret = (function() {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function addCaretStyle() {
|
||||||
|
var style = '.CaretBrowsing_Caret {' +
|
||||||
|
' position: absolute;' +
|
||||||
|
' z-index: 2147483647;' +
|
||||||
|
' min-height: 10px;' +
|
||||||
|
' background-color: #000;' +
|
||||||
|
'}' +
|
||||||
|
'.CaretBrowsing_AnimateCaret {' +
|
||||||
|
' position: absolute;' +
|
||||||
|
' z-index: 2147483647;' +
|
||||||
|
' min-height: 10px;' +
|
||||||
|
'}' +
|
||||||
|
'.CaretBrowsing_FlashVert {' +
|
||||||
|
' position: absolute;' +
|
||||||
|
' z-index: 2147483647;' +
|
||||||
|
' background: linear-gradient(' +
|
||||||
|
' 270deg,' +
|
||||||
|
' rgba(128, 128, 255, 0) 0%,' +
|
||||||
|
' rgba(128, 128, 255, 0.3) 45%,' +
|
||||||
|
' rgba(128, 128, 255, 0.8) 50%,' +
|
||||||
|
' rgba(128, 128, 255, 0.3) 65%,' +
|
||||||
|
' rgba(128, 128, 255, 0) 100%);' +
|
||||||
|
'}';
|
||||||
|
var node = document.createElement('style');
|
||||||
|
node.innerHTML = style;
|
||||||
|
document.body.appendChild(node);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there's no initial selection, set the cursor just before the
|
* If there's no initial selection, set the cursor just before the
|
||||||
* first text character in the document.
|
* first text character in the document.
|
||||||
*/
|
*/
|
||||||
funcs.setInitialCursor = () => {
|
funcs.setInitialCursor = () => {
|
||||||
if (!CaretBrowsing.initiated) {
|
if (!CaretBrowsing.initiated) {
|
||||||
|
addCaretStyle();
|
||||||
CaretBrowsing.setInitialCursor();
|
CaretBrowsing.setInitialCursor();
|
||||||
} else {
|
} else {
|
||||||
positionCaret();
|
positionCaret();
|
||||||
|
Loading…
Reference in New Issue
Block a user