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

Side by Side Diff: remoting/webapp/me2mom/host_table_entry.js

Issue 8624006: Remove the edit box, even if no change is made to the host name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 an entry in the host-list portion of the home screen. 7 * Class representing an entry in the host-list portion of the home screen.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 /** 145 /**
146 * Accept the hostname entered by the user. 146 * Accept the hostname entered by the user.
147 * @return {void} Nothing. 147 * @return {void} Nothing.
148 * @private 148 * @private
149 */ 149 */
150 remoting.HostTableEntry.prototype.commitRename_ = function() { 150 remoting.HostTableEntry.prototype.commitRename_ = function() {
151 var editBox = this.hostNameCell_.querySelector('input'); 151 var editBox = this.hostNameCell_.querySelector('input');
152 if (editBox) { 152 if (editBox) {
153 if (this.host.hostName != editBox.value) { 153 if (this.host.hostName != editBox.value) {
154 this.host.hostName = editBox.value; 154 this.host.hostName = editBox.value;
155 this.removeEditBox_();
156 this.onRename_(); 155 this.onRename_();
157 return;
158 } 156 }
157 this.removeEditBox_();
159 } 158 }
160 }; 159 };
161 160
162 /** 161 /**
163 * Remove the edit box corresponding to the specified host, and reset its name. 162 * Remove the edit box corresponding to the specified host, and reset its name.
164 * @return {void} Nothing. 163 * @return {void} Nothing.
165 * @private 164 * @private
166 */ 165 */
167 remoting.HostTableEntry.prototype.removeEditBox_ = function() { 166 remoting.HostTableEntry.prototype.removeEditBox_ = function() {
168 var editBox = this.hostNameCell_.querySelector('input'); 167 var editBox = this.hostNameCell_.querySelector('input');
(...skipping 11 matching lines...) Expand all
180 * @return {void} Nothing. 179 * @return {void} Nothing.
181 * @private 180 * @private
182 */ 181 */
183 remoting.HostTableEntry.prototype.onKeydown_ = function(event) { 182 remoting.HostTableEntry.prototype.onKeydown_ = function(event) {
184 if (event.which == 27) { // Escape 183 if (event.which == 27) { // Escape
185 this.removeEditBox_(); 184 this.removeEditBox_();
186 } else if (event.which == 13) { // Enter 185 } else if (event.which == 13) { // Enter
187 this.commitRename_(); 186 this.commitRename_();
188 } 187 }
189 }; 188 };
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