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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var Page = cr.ui.pageManager.Page; | 7 var Page = cr.ui.pageManager.Page; |
8 var PageManager = cr.ui.pageManager.PageManager; | 8 var PageManager = cr.ui.pageManager.PageManager; |
9 var ArrayDataModel = cr.ui.ArrayDataModel; | 9 var ArrayDataModel = cr.ui.ArrayDataModel; |
10 var RepeatingButton = cr.ui.RepeatingButton; | 10 var RepeatingButton = cr.ui.RepeatingButton; |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
738 // end event as the upcoming code will cancel the current one. | 738 // end event as the upcoming code will cancel the current one. |
739 if (section.classList.contains('sliding')) | 739 if (section.classList.contains('sliding')) |
740 cr.dispatchSimpleEvent(section, 'webkitTransitionEnd'); | 740 cr.dispatchSimpleEvent(section, 'webkitTransitionEnd'); |
741 | 741 |
742 this.addTransitionEndListener_(section); | 742 this.addTransitionEndListener_(section); |
743 | 743 |
744 section.hidden = false; | 744 section.hidden = false; |
745 section.style.height = (showing ? 0 : container.offsetHeight) + 'px'; | 745 section.style.height = (showing ? 0 : container.offsetHeight) + 'px'; |
746 section.classList.add('sliding'); | 746 section.classList.add('sliding'); |
747 | 747 |
748 // Force a style recalc before starting the animation. | |
Dan Beam
2014/09/10 22:56:34
can you please add a
/** @suppress {uselessCod
michaelpg
2014/09/10 23:19:52
Done.
| |
749 section.offsetHeight; | |
750 | |
748 if (this.sectionHeightChangeTimeout_ !== null) | 751 if (this.sectionHeightChangeTimeout_ !== null) |
749 clearTimeout(this.sectionHeightChangeTimeout_); | 752 clearTimeout(this.sectionHeightChangeTimeout_); |
750 | 753 |
751 this.sectionHeightChangeTimeout_ = setTimeout(function() { | 754 this.sectionHeightChangeTimeout_ = setTimeout(function() { |
752 section.style.height = (showing ? container.offsetHeight : 0) + 'px'; | 755 section.style.height = (showing ? container.offsetHeight : 0) + 'px'; |
753 this.sectionHeightChangeTimeout_ = null; | 756 this.sectionHeightChangeTimeout_ = null; |
754 }); | 757 }); |
Dan Beam
2014/09/10 22:56:34
i don't think you need anything involving setTimeo
michaelpg
2014/09/10 23:19:52
Done.
| |
755 }, | 758 }, |
756 | 759 |
757 /** | 760 /** |
758 * Shows the given section. | 761 * Shows the given section. |
759 * @param {HTMLElement} section The section to be shown. | 762 * @param {HTMLElement} section The section to be shown. |
760 * @param {HTMLElement} container The container for the section. Must be | 763 * @param {HTMLElement} container The container for the section. Must be |
761 * inside of |section|. | 764 * inside of |section|. |
762 * @param {boolean} animate Indicate if the expansion should be animated. | 765 * @param {boolean} animate Indicate if the expansion should be animated. |
763 * @private | 766 * @private |
764 */ | 767 */ |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1974 BrowserOptions.getLoggedInUsername = function() { | 1977 BrowserOptions.getLoggedInUsername = function() { |
1975 return BrowserOptions.getInstance().username_; | 1978 return BrowserOptions.getInstance().username_; |
1976 }; | 1979 }; |
1977 } | 1980 } |
1978 | 1981 |
1979 // Export | 1982 // Export |
1980 return { | 1983 return { |
1981 BrowserOptions: BrowserOptions | 1984 BrowserOptions: BrowserOptions |
1982 }; | 1985 }; |
1983 }); | 1986 }); |
OLD | NEW |