Skip to content

support old IE browsers in url hash processing js #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions lib/hash-to-query/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ module.exports = {
if (type === 'body') {
return `
<script type='text/javascript'>
let hash = window.location.hash;
var hash = window.location.hash;
if (hash && hash.length > 1) {
let pathName = window.location.pathname;
console.log(pathName);
if (!pathName.includes('/methods/') &&
!pathName.includes('/properties/') &&
!pathName.includes('/events/')) {
let type = hash.slice(1, hash.indexOf('_'));
let name = hash.slice(hash.indexOf('_') + 1, hash.length);
let anchor = '?anchor=' + name + '&show=inherited,protected,private,deprecated';
let newPath = pathName;
var pathName = window.location.pathname;
if (pathName.indexOf('/methods/') === -1 &&
pathName.indexOf('/properties/') === -1 &&
pathName.indexOf('/events/') === -1) {
var type = hash.slice(1, hash.indexOf('_'));
var name = hash.slice(hash.indexOf('_') + 1, hash.length);
var anchor = '?anchor=' + name + '&show=inherited,protected,private,deprecated';
var newPath = pathName;
if (type === 'method') {
newPath = pathName + '/methods/' + name;
} else if (type === 'property') {
Expand Down