Skip to content

Commit 64b4f4f

Browse files
authored
Merge pull request #2295 from IgniteUI/sstoychev/use-css-instead-of-class
fix(*): resolving csp violations by using $.css
2 parents 34a7b08 + f761207 commit 64b4f4f

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

src/js/modules/infragistics.util.jquery.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,19 +1112,31 @@
11121112

11131113
// Returns the width of the vertical scrollbar
11141114
$.ig.util.getScrollWidth = function () {
1115-
var el = $('<div style="width: 100px; height: 100px; position: absolute; ' +
1116-
'top: -10000px; left: -10000px; overflow: scroll"></div>')
1117-
.appendTo($(document.body)), scrollWidth;
1115+
var el = $("<div></div>").appendTo($(document.body)), scrollWidth;
1116+
el.css({
1117+
"width": "100px",
1118+
"height": "100px",
1119+
"position": "absolute",
1120+
"top": "-10000px",
1121+
"left": "-10000px",
1122+
"overflow": "scroll"
1123+
});
11181124
scrollWidth = el[ 0 ].offsetWidth - el[ 0 ].clientWidth;
11191125
el.remove();
11201126
return scrollWidth;
11211127
};
11221128

11231129
// Returns the height of the horizontal scrollbar
11241130
$.ig.util.getScrollHeight = function () {
1125-
var el = $('<div style="width: 100px; height: 100px; position: absolute; ' +
1126-
'top: -10000px; left: -10000px; overflow: scroll"></div>')
1127-
.appendTo($(document.body)), scrollHeight;
1131+
var el = $("<div></div>").appendTo($(document.body)), scrollHeight;
1132+
el.css({
1133+
"width": "100px",
1134+
"height": "100px",
1135+
"position": "absolute",
1136+
"top": "-10000px",
1137+
"left": "-10000px",
1138+
"overflow": "scroll"
1139+
});
11281140
scrollHeight = el[ 0 ].offsetHeight - el[ 0 ].clientHeight;
11291141
el.remove();
11301142
return scrollHeight;

0 commit comments

Comments
 (0)