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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 ///////////////////////////////////////////////////////////////////////////// | 6 ///////////////////////////////////////////////////////////////////////////// |
7 // OptionsPage class: | 7 // OptionsPage class: |
8 | 8 |
9 /** | 9 /** |
10 * Base class for options page. | 10 * Base class for options page. |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
716 * Updates all frozen pages to match the horizontal scroll position. | 716 * Updates all frozen pages to match the horizontal scroll position. |
717 * @private | 717 * @private |
718 */ | 718 */ |
719 OptionsPage.updateAllFrozenElementPositions_ = function() { | 719 OptionsPage.updateAllFrozenElementPositions_ = function() { |
720 var frozenElements = document.querySelectorAll('.frozen'); | 720 var frozenElements = document.querySelectorAll('.frozen'); |
721 for (var i = 0; i < frozenElements.length; i++) | 721 for (var i = 0; i < frozenElements.length; i++) |
722 this.updateFrozenElementHorizontalPosition_(frozenElements[i]); | 722 this.updateFrozenElementHorizontalPosition_(frozenElements[i]); |
723 }; | 723 }; |
724 | 724 |
725 /** | 725 /** |
726 * Update the left of all the position: fixed; header elements. | 726 * Update the left margin of all the position: fixed; header elements. |
727 * @private | 727 * @private |
728 */ | 728 */ |
729 OptionsPage.updateAllHeaderElementPositions_ = function() { | 729 OptionsPage.updateAllHeaderElementPositions_ = function() { |
730 var translate = 'translateX(' + (document.body.scrollLeft * -1) + 'px)'; | 730 var marginLeft = (document.body.scrollLeft * -1) + 'px'; |
Dan Beam
2012/01/31 22:08:39
rtl
csilv
2012/01/31 22:43:28
Done.
| |
731 for (var i = 0; i < this.fixedHeaders_.length; ++i) | 731 for (var i = 0; i < this.fixedHeaders_.length; ++i) |
732 this.fixedHeaders_[i].style.webkitTransform = translate; | 732 this.fixedHeaders_[i].style.marginLeft = marginLeft; |
733 | 733 |
734 uber.invokeMethodOnParent('adjustToScroll', document.body.scrollLeft); | 734 uber.invokeMethodOnParent('adjustToScroll', document.body.scrollLeft); |
735 }; | 735 }; |
736 | 736 |
737 /** | 737 /** |
738 * Updates the given frozen element to match the horizontal scroll position. | 738 * Updates the given frozen element to match the horizontal scroll position. |
739 * @param {HTMLElement} e The frozen element to update | 739 * @param {HTMLElement} e The frozen element to update |
740 * @private | 740 * @private |
741 */ | 741 */ |
742 OptionsPage.updateFrozenElementHorizontalPosition_ = function(e) { | 742 OptionsPage.updateFrozenElementHorizontalPosition_ = function(e) { |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1102 canShowPage: function() { | 1102 canShowPage: function() { |
1103 return true; | 1103 return true; |
1104 }, | 1104 }, |
1105 }; | 1105 }; |
1106 | 1106 |
1107 // Export | 1107 // Export |
1108 return { | 1108 return { |
1109 OptionsPage: OptionsPage | 1109 OptionsPage: OptionsPage |
1110 }; | 1110 }; |
1111 }); | 1111 }); |
OLD | NEW |