Skip to content

Fix JS errors when "Open in new window" menu is hidden #52

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 1 commit into from
Dec 22, 2016

Conversation

tommcc
Copy link
Contributor

@tommcc tommcc commented Oct 30, 2016

Setting the ishControlsHide.views-new flag to true (thereby hiding the "Open in new window" menu item) would cause JS errors in the browser. The JS was trying to manipulate the #sg-raw element, which isn't there.

Fixes:

  • In two places, checks for the nonexistence of the menu item were in place, but checking against the wrong value (document.getElementById() returns null when no results, not undefined). Corrected.
  • In one place, the check was missing. Added.

@bmuenzenmeyer bmuenzenmeyer self-assigned this Dec 22, 2016
@bmuenzenmeyer bmuenzenmeyer merged commit fdce677 into pattern-lab:dev Dec 22, 2016
bmuenzenmeyer added a commit that referenced this pull request Dec 22, 2016
@bmuenzenmeyer bmuenzenmeyer mentioned this pull request Dec 22, 2016
@tommcc tommcc deleted the fix-sg-raw-checks branch October 30, 2017 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants