Skip to content

Commit

Permalink
fix delay time call
Browse files Browse the repository at this point in the history
  • Loading branch information
ariellalgilmore committed Aug 31, 2023
1 parent afc6dec commit be5f596
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion content/patterns/feed/examples/feed-display.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script src="../../../shared/js/utils.js"></script>
<script src="js/feed.js"></script>
<script src="js/feedDisplay.js"></script>
<!-- <script src="js/main.js"></script> -->
<script src="js/main.js"></script>
</head>
<body>
<h3>Recommended Restaurants</h3>
Expand Down
8 changes: 1 addition & 7 deletions content/patterns/feed/examples/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
<script src="../../../shared/js/highlight.pack.js"></script>
<script src="../../../shared/js/app.js"></script>
<script src="../../../shared/js/skipto.js"></script>

<!-- JS and CSS for this example -->
<script src="../../../shared/js/utils.js"></script>
<script src="js/feed.js"></script>
<script src="js/feedDisplay.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<nav aria-label="Related Links" class="feedback">
Expand Down Expand Up @@ -54,7 +48,7 @@ <h2 id="ex_label">Example</h2>
<label for="delay-time-select">Select article loading delay</label>
<select id="delay-time-select" name="delay_time">
<option value="200">200 ms</option>
<option value="800">800 ms</option>
<option value="400">400 ms</option>
</select>
</div>
<iframe id="feed_frame" src="./feed-display.html" height="500" title="Feed example" style="width: 100%"></iframe>
Expand Down
9 changes: 3 additions & 6 deletions content/patterns/feed/examples/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
* @function onload
* @description Initialize the feed once the page has loaded
*/
document.getElementById('feed_frame').addEventListener('load', function () {
// var feedNode = document.getElementById('restaurant-feed');
var iframe = document.getElementById('feed_frame');
var feedNode =
iframe.contentWindow.document.getElementById('restaurant-feed');
var delaySelect = document.getElementById('delay-time-select');
window.addEventListener('load', function () {
var feedNode = document.getElementById('restaurant-feed');
var delaySelect = window.parent.document.getElementById('delay-time-select');
var restaurantFeed = new aria.Feed(feedNode, delaySelect);

var restaurantFeedDisplay = new aria.FeedDisplay(restaurantFeed, function () {
Expand Down

0 comments on commit be5f596

Please sign in to comment.