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 the host-list portion of the home screen UI. | 7 * Class representing the host-list portion of the home screen UI. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 /** | 192 /** |
193 * Show or hide the host-list UI. | 193 * Show or hide the host-list UI. |
194 * | 194 * |
195 * @param {boolean} show True to show the UI, or false to hide it. | 195 * @param {boolean} show True to show the UI, or false to hide it. |
196 * @return {void} Nothing. | 196 * @return {void} Nothing. |
197 * @private | 197 * @private |
198 */ | 198 */ |
199 remoting.HostList.prototype.showOrHide_ = function(show) { | 199 remoting.HostList.prototype.showOrHide_ = function(show) { |
200 var parent = /** @type {Element} */ (this.table_.parentNode); | 200 var parent = /** @type {Element} */ (this.table_.parentNode); |
201 parent.hidden = !show; | 201 parent.hidden = !show; |
202 if (show) { | |
203 removeClass(parent, remoting.HostList.COLLAPSED_); | |
204 } else { | |
205 addClass(parent, remoting.HostList.COLLAPSED_); | |
206 } | |
Jamie
2012/03/03 01:38:08
The 'collapsed' style was used to animate the host
| |
207 }; | 202 }; |
208 | 203 |
209 /** | 204 /** |
210 * Remove a host from the list, and deregister it. | 205 * Remove a host from the list, and deregister it. |
211 * @param {remoting.HostTableEntry} hostTableEntry The host to be removed. | 206 * @param {remoting.HostTableEntry} hostTableEntry The host to be removed. |
212 * @return {void} Nothing. | 207 * @return {void} Nothing. |
213 * @private | 208 * @private |
214 */ | 209 */ |
215 remoting.HostList.prototype.deleteHost_ = function(hostTableEntry) { | 210 remoting.HostList.prototype.deleteHost_ = function(hostTableEntry) { |
216 this.table_.removeChild(hostTableEntry.tableRow); | 211 this.table_.removeChild(hostTableEntry.tableRow); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 'https://www.googleapis.com/chromoting/v1/@me/hosts/' + | 249 'https://www.googleapis.com/chromoting/v1/@me/hosts/' + |
255 hostTableEntry.host.hostId, | 250 hostTableEntry.host.hostId, |
256 function(xhr) {}, | 251 function(xhr) {}, |
257 JSON.stringify(newHostDetails), | 252 JSON.stringify(newHostDetails), |
258 headers); | 253 headers); |
259 } | 254 } |
260 remoting.oauth2.callWithToken(renameHost); | 255 remoting.oauth2.callWithToken(renameHost); |
261 }; | 256 }; |
262 | 257 |
263 /** | 258 /** |
264 * Class name for the host list when it is collapsed. | |
265 * @private | |
266 */ | |
267 remoting.HostList.COLLAPSED_ = 'collapsed'; | |
268 | |
269 /** | |
270 * Key name under which Me2Me hosts are cached. | 259 * Key name under which Me2Me hosts are cached. |
271 */ | 260 */ |
272 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; | 261 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; |
273 | 262 |
274 /** @type {remoting.HostList} */ | 263 /** @type {remoting.HostList} */ |
275 remoting.hostList = null; | 264 remoting.hostList = null; |
OLD | NEW |