Bug 765729 - New Tab page thumbnails can't be tabbed to r=ttaubert

This commit is contained in:
Andres Hernandez [:andreshm] 2012-06-25 14:03:26 -06:00
parent c5e60cfbe6
commit 67cfa937c9
2 changed files with 12 additions and 9 deletions

View File

@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
-moz-user-focus: normal;
}
input[type=button] {
cursor: pointer;
}
@ -15,6 +11,7 @@ input[type=button] {
display: -moz-box;
position: relative;
-moz-box-flex: 1;
-moz-user-focus: normal;
}
#newtab-scrollbox:not([page-disabled]) {

View File

@ -80,18 +80,24 @@ let gPage = {
* @param aValue Whether the New Tab Page is enabled or not.
*/
_updateAttributes: function Page_updateAttributes(aValue) {
let selector = "#newtab-scrollbox, #newtab-toggle, #newtab-grid";
let nodes = document.querySelectorAll(selector);
// Set the nodes' states.
for (let i = 0; i < nodes.length; i++) {
let node = nodes[i];
let nodeSelector = "#newtab-scrollbox, #newtab-toggle, #newtab-grid";
for (let node of document.querySelectorAll(nodeSelector)) {
if (aValue)
node.removeAttribute("page-disabled");
else
node.setAttribute("page-disabled", "true");
}
// Enables/disables the control and link elements.
let inputSelector = ".newtab-control, .newtab-link";
for (let input of document.querySelectorAll(inputSelector)) {
if (aValue)
input.removeAttribute("tabindex");
else
input.setAttribute("tabindex", "-1");
}
// Update the toggle button's title.
let toggle = document.getElementById("newtab-toggle");
toggle.setAttribute("title", newTabString(aValue ? "hide" : "show"));