<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>YouTube Notes</title>
  <script>
    window.Polymer = window.Polymer || {};
    window.Polymer.dom = 'shadow';
  </script>
  <script src="node_modules/page/page.js"></script>
  <style>
    body {
      background: #f5f5f5;
      font-family: verdana;
    }
  </style>
  <script>
    (function () {
      page('/:event', function (context, next) {
        context.handled = true;

        console.log(context);
        changeEventId(context.params.event);

        next();
      });

      function changeEventId(newId) {
        document.getElementsByTagName('youtube-notes')[0].setAttribute('event', newId);
      }

      page.start();
    })();
  </script>
  <link rel="import" href="./youtube-notes.html" />
</head>
<body>
  <youtube-notes></youtube-notes>
</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>YouTube Notes</title>
  <script>
    window.Polymer = window.Polymer || {};
    window.Polymer.dom = 'shadow';
  </script>
  <script src="node_modules/page/page.js"></script>
  <style>
    body {
      background: #f5f5f5;
      font-family: verdana;
    }
  </style>
  <script>
    (function () {
      // Called when user returns to the initial
      //   view with back arrow navigation.
      page('/', function (context, next) {
        context.handled = true;

        console.log(context);
        changeEventId(context.params.event);

        next();
      });

      // Called when user navigates to any valid or invalid web page?
      // Called when user navigates to a view.
      page('/:event', function (context, next) {
        context.handled = true;

        console.log(context);
        changeEventId(context.params.event);

        next();
      });

      function changeEventId(newId) {
        document.getElementsByTagName('youtube-notes')[0].setAttribute('event', newId);
      }

      page.start();
    })();
  </script>
  <link rel="import" href="./youtube-notes.html" />
</head>
<body>
  <youtube-notes></youtube-notes>
</body>
</html>

Add page call to handle navigating back to the initial page. Does not do much yet.
Add page call to handle navigating back to the initial page. Does not do much yet.
