Skip to content

Commit

Permalink
fix: custom scrollbar breaks csp mode (#4967)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Oct 18, 2022
1 parent 96e4066 commit be8eb12
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions src/scrollbar_custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,44 @@ var dom = require("./lib/dom");
var event = require("./lib/event");
var EventEmitter = require("./lib/event_emitter").EventEmitter;

dom.importCssString('.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n' + ' position: absolute;\n'
+ ' background: rgba(128, 128, 128, 0.6);\n' + ' -moz-box-sizing: border-box;\n' + ' box-sizing: border-box;\n'
+ ' border: 1px solid #bbb;\n' + ' border-radius: 2px;\n' + ' z-index: 8;\n' + '}\n'
+ '.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n' + ' position: absolute;\n' + ' z-index: 6;\n'
+ ' background: none;' + ' overflow: hidden!important;\n' + '}\n' + '.ace_editor>.ace_sb-v {\n'
+ ' z-index: 6;\n' + ' right: 0;\n' + ' top: 0;\n' + ' width: 12px;\n' + '}' + '.ace_editor>.ace_sb-v div {\n'
+ ' z-index: 8;\n' + ' right: 0;\n' + ' width: 100%;\n' + '}' + '.ace_editor>.ace_sb-h {\n' + ' bottom: 0;\n'
+ ' left: 0;\n' + ' height: 12px;\n' + '}' + '.ace_editor>.ace_sb-h div {\n' + ' bottom: 0;\n'
+ ' height: 100%;\n' + '}' + '.ace_editor>.ace_sb_grabbed {\n' + ' z-index: 8;\n' + ' background: #000;\n'
+ '}');
dom.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
position: absolute;
background: rgba(128, 128, 128, 0.6);
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #bbb;
border-radius: 2px;
z-index: 8;
}
.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
position: absolute;
z-index: 6;
background: none;' + ' overflow: hidden!important;
}
.ace_editor>.ace_sb-v {
z-index: 6;
right: 0;
top: 0;
width: 12px;
}
.ace_editor>.ace_sb-v div {
z-index: 8;
right: 0;
width: 100%;
}
.ace_editor>.ace_sb-h {
bottom: 0;
left: 0;
height: 12px;
}
.ace_editor>.ace_sb-h div {
bottom: 0;
height: 100%;
}
.ace_editor>.ace_sb_grabbed {
z-index: 8;
background: #000;
}`, "ace_scrollbar.css", false);

/**
* An abstract class representing a native scrollbar control.
Expand Down

0 comments on commit be8eb12

Please sign in to comment.