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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Class representing a menu button and its associated menu items. | 7 * Class representing a menu button and its associated menu items. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 }; | 99 }; |
100 | 100 |
101 /** | 101 /** |
102 * Set or unset the selected state of an <li> menu item. | 102 * Set or unset the selected state of an <li> menu item. |
103 * @param {Element} item The menu item to update. | 103 * @param {Element} item The menu item to update. |
104 * @param {boolean} selected True to select the item, false to deselect it. | 104 * @param {boolean} selected True to select the item, false to deselect it. |
105 * @return {void} Nothing. | 105 * @return {void} Nothing. |
106 */ | 106 */ |
107 remoting.MenuButton.select = function(item, selected) { | 107 remoting.MenuButton.select = function(item, selected) { |
108 if (selected) { | 108 if (selected) { |
109 /** @type {DOMTokenList} */(item.classList).add('selected'); | 109 item.classList.add('selected'); |
110 } else { | 110 } else { |
111 /** @type {DOMTokenList} */(item.classList).remove('selected'); | 111 item.classList.remove('selected'); |
112 } | 112 } |
113 }; | 113 }; |
114 | 114 |
115 /** @const @private */ | 115 /** @const @private */ |
116 remoting.MenuButton.BUTTON_ACTIVE_CLASS_ = 'active'; | 116 remoting.MenuButton.BUTTON_ACTIVE_CLASS_ = 'active'; |
OLD | NEW |