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

Side by Side Diff: chrome/browser/resources/options2/options_page.js

Issue 9318009: [uber page] Fix the missing cancel button on the settings search field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Tweak tweak... Created 8 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 start 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 adjust = isRTL() ? 1 : -1;
731 var marginStart = document.body.scrollLeft * adjust + 'px';
731 for (var i = 0; i < this.fixedHeaders_.length; ++i) 732 for (var i = 0; i < this.fixedHeaders_.length; ++i)
732 this.fixedHeaders_[i].style.webkitTransform = translate; 733 this.fixedHeaders_[i].style.webkitMarginStart = marginStart;
733 734
734 uber.invokeMethodOnParent('adjustToScroll', document.body.scrollLeft); 735 uber.invokeMethodOnParent('adjustToScroll', document.body.scrollLeft);
735 }; 736 };
736 737
737 /** 738 /**
738 * Updates the given frozen element to match the horizontal scroll position. 739 * Updates the given frozen element to match the horizontal scroll position.
739 * @param {HTMLElement} e The frozen element to update 740 * @param {HTMLElement} e The frozen element to update
740 * @private 741 * @private
741 */ 742 */
742 OptionsPage.updateFrozenElementHorizontalPosition_ = function(e) { 743 OptionsPage.updateFrozenElementHorizontalPosition_ = function(e) {
743 if (document.documentElement.dir == 'rtl') 744 if (isRTL())
744 e.style.right = HORIZONTAL_OFFSET + 'px'; 745 e.style.right = HORIZONTAL_OFFSET + 'px';
745 else 746 else
746 e.style.left = HORIZONTAL_OFFSET - document.body.scrollLeft + 'px'; 747 e.style.left = HORIZONTAL_OFFSET - document.body.scrollLeft + 'px';
747 }; 748 };
748 749
749 /** 750 /**
750 * Called when the page is resized; adjusts the size of elements that depend 751 * Called when the page is resized; adjusts the size of elements that depend
751 * on the veiwport. 752 * on the veiwport.
752 * @param {Event} e The resize event. 753 * @param {Event} e The resize event.
753 * @private 754 * @private
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 canShowPage: function() { 1103 canShowPage: function() {
1103 return true; 1104 return true;
1104 }, 1105 },
1105 }; 1106 };
1106 1107
1107 // Export 1108 // Export
1108 return { 1109 return {
1109 OptionsPage: OptionsPage 1110 OptionsPage: OptionsPage
1110 }; 1111 };
1111 }); 1112 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698