From 6653da8ee4499d1beb23b7f4619139335de2ea6a Mon Sep 17 00:00:00 2001 From: jelhan Date: Sat, 13 Aug 2016 18:46:46 +0200 Subject: [PATCH] Fix: CSP style-src: 'unsafe-inline' violation Could get rid of `style-src: 'unsafe-inline'` after https://github.com/mkoryak/floatThead/pull/321 has been merged and made it's way in a new release. Part of #90 --- .../poll-evaluation-participants-table.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/components/poll-evaluation-participants-table.js b/app/components/poll-evaluation-participants-table.js index 8d74b32..196d770 100644 --- a/app/components/poll-evaluation-participants-table.js +++ b/app/components/poll-evaluation-participants-table.js @@ -91,7 +91,19 @@ export default Ember.Component.extend({ * calculates horizontal scrollbar height depending on current browser */ getScrollbarHeight() { - const wideScrollWtml = '
'; + const wideScrollWtml = Ember.$('
').attr('id', 'wide_scroll_div_one').css({ + 'width': 50, + 'height': 50, + 'overflow-y': 'scroll', + 'position': 'absolute', + 'top': -200, + 'left': -200 + }).append( + Ember.$('
').attr('id', 'wide_scroll_div_two').css({ + 'height': '100%', + 'width': 100 + }) + ); Ember.$('body').append(wideScrollWtml); // Append our div and add the hmtl to your document for calculations const scrollW1 = Ember.$('#wide_scroll_div_one').height(); // Getting the width of the surrounding(parent) div - we already know it is 50px since we styled it but just to make sure. const scrollW2 = Ember.$('#wide_scroll_div_two').innerHeight(); // Find the inner width of the inner(child) div.