-
-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of loading imported-strings-as-js we just refer to the asset files of the device. Also, move the `scripts` code to the bottom of the page. This was initially moved to the top so the reported error code-lines are more predictable (the different html was messing up the count). Now we don't need that, so simplify.
- Loading branch information
1 parent
ae2bc6a
commit a7e74f0
Showing
2 changed files
with
8 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
/* @flow */ | ||
import smoothScroll from './smoothScroll.min'; | ||
import matchesPolyfill from './matchesPolyfill'; | ||
import js from './generatedEs3'; | ||
import config from '../../config'; | ||
import { getWebviewResource } from '../webviewHelpers'; | ||
|
||
export default (anchor: number): string => ` | ||
<script src="${getWebviewResource('smooth-scroll.js')}"></script> | ||
<script src="${getWebviewResource('matches-polyfill.js')}"></script> | ||
<script src="${getWebviewResource('zulip.js')}"></script> | ||
<script> | ||
window.__forceSmoothScrollPolyfill__ = true; | ||
${smoothScroll} | ||
${matchesPolyfill} | ||
window.enableWebViewErrorDisplay = ${config.enableWebViewErrorDisplay.toString()}; | ||
document.addEventListener('DOMContentLoaded', function() { | ||
${js} | ||
scrollToAnchor(${anchor}); | ||
scrollEventsDisabled = false; | ||
sendScrollMessageIfListShort(); | ||
}); | ||
scrollToAnchor(${anchor}); | ||
scrollEventsDisabled = false; | ||
sendScrollMessageIfListShort(); | ||
</script> | ||
`; |