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 ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; | 9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; |
10 | 10 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
664 * @private | 664 * @private |
665 */ | 665 */ |
666 animatedSectionHeightChange_: function(section, container, showing) { | 666 animatedSectionHeightChange_: function(section, container, showing) { |
667 // If the section is already animating, dispatch a synthetic transition | 667 // If the section is already animating, dispatch a synthetic transition |
668 // end event as the upcoming code will cancel the current one. | 668 // end event as the upcoming code will cancel the current one. |
669 if (section.classList.contains('sliding')) | 669 if (section.classList.contains('sliding')) |
670 cr.dispatchSimpleEvent(section, 'webkitTransitionEnd'); | 670 cr.dispatchSimpleEvent(section, 'webkitTransitionEnd'); |
671 | 671 |
672 this.addTransitionEndListener_(section); | 672 this.addTransitionEndListener_(section); |
673 | 673 |
674 section.hidden = false; | |
675 section.style.height = (showing ? 0 : container.offsetHeight) + 'px'; | 674 section.style.height = (showing ? 0 : container.offsetHeight) + 'px'; |
676 section.classList.add('sliding'); | 675 window.requestAnimationFrame(function() { |
Dan Beam
2014/07/15 23:04:15
please handle the case where a user toggles the ch
michaelpg
2014/07/15 23:18:32
will do. Does this make sense to you otherwise? I
michaelpg
2014/08/22 22:17:58
The current implementation has another bug. If you
| |
676 section.hidden = false; | |
677 section.classList.add('sliding'); | |
677 | 678 |
678 if (this.sectionHeightChangeTimeout_ !== null) | 679 window.requestAnimationFrame(function() { |
679 clearTimeout(this.sectionHeightChangeTimeout_); | 680 section.style.height = (showing ? container.offsetHeight : 0) + 'px'; |
680 | 681 }); |
681 this.sectionHeightChangeTimeout_ = setTimeout(function() { | |
682 section.style.height = (showing ? container.offsetHeight : 0) + 'px'; | |
683 this.sectionHeightChangeTimeout_ = null; | |
684 }); | 682 }); |
685 }, | 683 }, |
686 | 684 |
687 /** | 685 /** |
688 * Shows the given section. | 686 * Shows the given section. |
689 * @param {HTMLElement} section The section to be shown. | 687 * @param {HTMLElement} section The section to be shown. |
690 * @param {HTMLElement} container The container for the section. Must be | 688 * @param {HTMLElement} container The container for the section. Must be |
691 * inside of |section|. | 689 * inside of |section|. |
692 * @param {boolean} animate Indicate if the expansion should be animated. | 690 * @param {boolean} animate Indicate if the expansion should be animated. |
693 * @private | 691 * @private |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1879 $('consumer-management-unenroll').hidden = !isEnrolled; | 1877 $('consumer-management-unenroll').hidden = !isEnrolled; |
1880 ConsumerManagementOverlay.setEnrollmentStatus(isEnrolled); | 1878 ConsumerManagementOverlay.setEnrollmentStatus(isEnrolled); |
1881 }; | 1879 }; |
1882 } | 1880 } |
1883 | 1881 |
1884 // Export | 1882 // Export |
1885 return { | 1883 return { |
1886 BrowserOptions: BrowserOptions | 1884 BrowserOptions: BrowserOptions |
1887 }; | 1885 }; |
1888 }); | 1886 }); |
OLD | NEW |