Skip to content

Commit

Permalink
fix: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shatgupt committed Nov 16, 2018
1 parent 8afd9ff commit 898f1ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion platforms/learntosolveit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

const langSelector = '.' + Object.keys(learntosolveit.languages).join(',.')
learntosolveit.getPage = () => {
console.log('getpage', $(langSelector))
if ($(langSelector)) return 'show' // if any of the supported languages exist on page
}

Expand Down
6 changes: 3 additions & 3 deletions platforms/xahlee.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

const injectRunButton = (btnContainer, fileName) => {
if (btnContainer.nextSibling.classList && btnContainer.nextSibling.classList.contains('runmycode-popup-runner')) return
if (btnContainer.nextElementSibling.classList && btnContainer.nextElementSibling.classList.contains('runmycode-popup-runner')) return
// insert after the pre node
btnContainer.parentNode.insertBefore(
buildDomElement(
Expand All @@ -42,14 +42,14 @@
'▶ Run'
]
),
btnContainer.nextSibling
btnContainer.nextElementSibling
)
}

xahlee.pages = {}
xahlee.pages.show = {
// run button is added just after the pre for code
getCodeContainer: (openRunnerBtn) => openRunnerBtn.previousSibling,
getCodeContainer: (openRunnerBtn) => openRunnerBtn.previousElementSibling,
hasSupportedLang: () => true, // always true for show page
injectRunButtons: () => {
$$('pre').forEach((codeContainer) => {
Expand Down

0 comments on commit 898f1ad

Please sign in to comment.