| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains the navigation controls that are visible on the left side | 5 // This file contains the navigation controls that are visible on the left side |
| 6 // of the uber page. It exists separately from uber.js so that it may be loaded | 6 // of the uber page. It exists separately from uber.js so that it may be loaded |
| 7 // in an iframe. Iframes can be layered on top of each other, but not mixed in | 7 // in an iframe. Iframes can be layered on top of each other, but not mixed in |
| 8 // with page content, so all overlapping content on uber must be framed. | 8 // with page content, so all overlapping content on uber must be framed. |
| 9 | 9 |
| 10 // <include src="../../../../ui/webui/resources/js/util.js"> | 10 // <include src="../../../../ui/webui/resources/js/util.js"> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * Adjusts this frame's content to scrolls from the outer frame. This is done | 116 * Adjusts this frame's content to scrolls from the outer frame. This is done |
| 117 * to obscure text in RTL as a user scrolls over the content of this frame (as | 117 * to obscure text in RTL as a user scrolls over the content of this frame (as |
| 118 * currently RTL scrollbars still draw on the right). | 118 * currently RTL scrollbars still draw on the right). |
| 119 * @param {number} scrollLeft document.body.scrollLeft of the content frame. | 119 * @param {number} scrollLeft document.body.scrollLeft of the content frame. |
| 120 */ | 120 */ |
| 121 function adjustToScroll(scrollLeft) { | 121 function adjustToScroll(scrollLeft) { |
| 122 assert(isRTL()); | 122 assert(isRTL()); |
| 123 document.body.style.webkitTransform = 'translateX(' + -scrollLeft + 'px)'; | 123 document.body.style.transform = 'translateX(' + -scrollLeft + 'px)'; |
| 124 } | 124 } |
| 125 | 125 |
| 126 /** | 126 /** |
| 127 * Enable/disable an animation to ease the nav bar back into view when | 127 * Enable/disable an animation to ease the nav bar back into view when |
| 128 * changing content while horizontally scrolled. | 128 * changing content while horizontally scrolled. |
| 129 * @param {boolean} enabled Whether easing should be enabled. | 129 * @param {boolean} enabled Whether easing should be enabled. |
| 130 */ | 130 */ |
| 131 function setContentChanging(enabled) { | 131 function setContentChanging(enabled) { |
| 132 assert(isRTL()); | 132 assert(isRTL()); |
| 133 document.documentElement.classList.toggle('changing-content', enabled); | 133 document.documentElement.classList.toggle('changing-content', enabled); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 return { | 175 return { |
| 176 onLoad: onLoad, | 176 onLoad: onLoad, |
| 177 setNavigationOverride: setNavigationOverride, | 177 setNavigationOverride: setNavigationOverride, |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 }); | 180 }); |
| 181 | 181 |
| 182 document.addEventListener('DOMContentLoaded', uber_frame.onLoad); | 182 document.addEventListener('DOMContentLoaded', uber_frame.onLoad); |
| OLD | NEW |