From 3ea416eae3c73db3041b1a0b140a1f59b5326e6f Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 1 May 2015 17:56:49 -0400 Subject: [PATCH] Disable feature detection on sidebar init --- RELEASE-NOTES.md | 2 ++ src/definitions/modules/sidebar.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 97b252287..a51fd2a66 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -58,6 +58,7 @@ - **Input** - Added placeholder color rules for IE, `ms-input-placeholder` - **Label** - Labels now have `active` and `active hover` states +- **Label** - Label now sets an `img` height even when not using an `image label` - **Menu** - Added `stackable` menu variation for simple responsive menus - **Menu** - Added many new variables to menu - **Menu** - Fixed several inheritance issues for `dropdown item` inside `menu` appearing as `menu item`. @@ -178,6 +179,7 @@ - **Message** - Slightly increases `box-shadow` - **Popup** - Popup no longer produces an error when a position cannot be found on the page. - **Segment** - **Clearfix** has been removed from `ui segment` +- **Sidebar** - Sidebar now defaults to `useLegacy: false` to avoid the overhead of feature detection for most users - **Search** - Slightly adjusted search result theme for clarity - **Site** - Increase contrast on default hovered/down colors for colored variations - **Site** - Page background is now `#FFFFFF` by default instead of an offwhite `#F7F7F7` diff --git a/src/definitions/modules/sidebar.js b/src/definitions/modules/sidebar.js index 420922a8a..af6f13111 100644 --- a/src/definitions/modules/sidebar.js +++ b/src/definitions/modules/sidebar.js @@ -101,7 +101,9 @@ $.fn.sidebar = function(parameters) { module.setup.layout(); } - module.setup.cache(); + requestAnimationFrame(function() { + module.setup.cache(); + }); module.instantiate(); }, @@ -305,7 +307,7 @@ $.fn.sidebar = function(parameters) { repaint: function() { module.verbose('Forcing repaint event'); element.style.display = 'none'; - element.offsetHeight; + var ignored = element.offsetHeight; element.scrollTop = element.scrollTop; element.style.display = ''; }, @@ -1061,7 +1063,7 @@ $.fn.sidebar.settings = { returnScroll : false, delaySetup : false, - useLegacy : 'auto', + useLegacy : false, duration : 500, easing : 'easeInOutQuint',