Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #11 from jostw/josyeh/Marketplace/master/Bug1233681
Browse files Browse the repository at this point in the history
Bug 1233681 - [TV][2.5] Update contextmenu id to the top element
  • Loading branch information
jostw committed Dec 31, 2015
2 parents 4461a6a + bc47211 commit 779dfc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/dev.html
Expand Up @@ -27,13 +27,17 @@
</script>
</head>

<body class="home" data-media="">
<body class="home" data-media="" contextmenu="contextmenu">
<noscript><p>Sorry, you need JavaScript to use this site.</p></noscript>

<main>
<div id="page" class="page" role="main"></div>
</main>

<menu type="context" id="contextmenu">
<menuitem></menuitem>
</menu>

{% if compiled %}
<script src="/media/js/include.js" defer></script>
{% else %}
Expand Down
5 changes: 5 additions & 0 deletions src/media/js/views/homepage.js
Expand Up @@ -6,6 +6,8 @@ define('views/homepage',
var gettext = l10n.gettext;
var appsModel = models('apps');

var appContextMenu = document.getElementById('contextmenu').children[0];

var $appPreview;
var $appList;

Expand Down Expand Up @@ -70,6 +72,9 @@ define('views/homepage',
var focusedApp = appsModel.lookup(this.dataset.slug);
var focusedManifestURL = focusedApp.manifest_url;

// Update context menu's label
appContextMenu.label = focusedManifestURL || '';

this.classList.add('focused');

// Update app preview area with current focused app.
Expand Down
8 changes: 1 addition & 7 deletions src/templates/homepage.html
Expand Up @@ -4,16 +4,10 @@
{% defer (url=api('apps'), pluck='objects', as='apps', key='slug') %}
<ul class="clearfix">
{% for app in this %}
<li class="app-list-app focusable" data-slug="{{ app.slug }}"
contextmenu="contextmenu-{{ loop.index }}">
<li class="app-list-app focusable" data-slug="{{ app.slug }}">
<img src="{{ app.icons['128'] }}"
alt="{{ app.name }}" title="{{ app.name }}">
<span class="name">{{ app.name }}</span>

<menu type="context" id="contextmenu-{{ loop.index }}">
<menuitem label="{{ app.manifest_url }}"></menuitem>
</menu>

</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit 779dfc1

Please sign in to comment.