diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-19 18:57:00 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-19 18:57:00 +0300 |
commit | 0925edb4ff4ae8c12648be7a59866340c81b9eff (patch) | |
tree | 6776923a9ad9196fa2edf0f25f0234950ea48aff /app/assets/javascripts/fly_out_nav.js | |
parent | 7505417478011e489e011c3cabf71c11a75e5da2 (diff) |
updated styles
Diffstat (limited to 'app/assets/javascripts/fly_out_nav.js')
-rw-r--r-- | app/assets/javascripts/fly_out_nav.js | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/app/assets/javascripts/fly_out_nav.js b/app/assets/javascripts/fly_out_nav.js index 202a8c18c22..1ae2e72410f 100644 --- a/app/assets/javascripts/fly_out_nav.js +++ b/app/assets/javascripts/fly_out_nav.js @@ -5,12 +5,7 @@ export const calculateTop = (boundingRect, outerHeight) => { return bottomOverflow < 0 ? boundingRect.top - Math.abs(bottomOverflow) : boundingRect.top; }; -export const createArrowStyles = (boundingRect, top) => `.sidebar-sub-level-items::before { transform: translate3d(0, ${boundingRect.top - top}px, 0); }`; - export default () => { - const style = document.createElement('style'); - document.head.appendChild(style); - $('.sidebar-top-level-items > li:not(.active)').on('mouseover', (e) => { const $this = e.currentTarget; const $subitems = $('.sidebar-sub-level-items', $this).show(); @@ -22,14 +17,6 @@ export default () => { $subitems.css({ transform: `translate3d(0, ${top}px, 0)`, }); - - style.sheet.insertRule(createArrowStyles(boundingRect, top), 0); - } - }).on('mouseout', (e) => { - $('.sidebar-sub-level-items', e.currentTarget).hide(); - - if (style.sheet.rules.length) { - style.sheet.deleteRule(0); } - }); + }).on('mouseout', e => $('.sidebar-sub-level-items', e.currentTarget).hide()); }; |