Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: ui/webui/resources/js/cr/ui/node_utils.js

Issue 682863004: print preview: Fix visual tab order for "Print"/"Cancel" buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.exportPath('cr.ui');
6
7 /**
8 * Reverse the child elements of any found button strips if they haven't already
9 * been reversed. This is necessary because WebKit does not alter the tab order
10 * for elements that are visually reversed using flex-direction: reverse, and
11 * the button order is reversed for views. See http://webk.it/62664 for more
12 * information.
13 * @param {Node=} opt_root Starting point for button strips to reverse.
14 */
15 cr.ui.reverseButtonStrips = function(opt_root) {
16 if (!(cr.isWindows || cr.isChromeOS)) {
17 // Only reverse on platforms that need it (differ from the HTML order).
18 return;
19 }
20
21 var root = opt_root || document;
22 var buttonStrips = root.querySelectorAll('.button-strip:not([reversed])');
23 for (var j = 0; j < buttonStrips.length; j++) {
24 var buttonStrip = buttonStrips[j];
25
26 var childNodes = buttonStrip.childNodes;
27 for (var i = childNodes.length - 1; i >= 0; i--) {
28 buttonStrip.appendChild(childNodes[i]);
29 }
30
31 buttonStrip.setAttribute('reversed', '');
32 }
33 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.html ('k') | ui/webui/resources/js/cr/ui/page_manager/page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698