From ffa76d02dcd0048b469bc74bc5a31185b5dcef54 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Tue, 30 May 2017 13:17:03 -0700 Subject: [PATCH] Only run tabbing logic on docs that contain blocks Summary: Builds upon #14212 Closes https://github.com/facebook/react-native/pull/14213 Differential Revision: D5149113 Pulled By: hramos fbshipit-source-id: 99684bbb3bcae0e6061641373c6af7446729d7bd --- website/src/react-native/js/scripts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/src/react-native/js/scripts.js b/website/src/react-native/js/scripts.js index e82efb3da..adf2deeaa 100644 --- a/website/src/react-native/js/scripts.js +++ b/website/src/react-native/js/scripts.js @@ -202,6 +202,10 @@ } function guessPlatformAndOS() { + if (!document.querySelector('block')) { + return; + } + // If we are coming to the page with a hash in it (i.e. from a search, for example), try to get // us as close as possible to the correct platform and dev os using the hashtag and block walk up. var foundHash = false;