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

Side by Side Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js

Issue 2627373002: MD Settings: Save and restore scroll position in iron-list (Closed)
Patch Set: Nits Created 3 years, 10 months 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 * 'settings-bluetooth-subpage' is the settings subpage for managing bluetooth 7 * 'settings-bluetooth-subpage' is the settings subpage for managing bluetooth
8 * properties and devices. 8 * properties and devices.
9 */ 9 */
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return this.bluetoothEnabled && !this.dialogId_; 166 return this.bluetoothEnabled && !this.dialogId_;
167 }, 167 },
168 168
169 /** @private */ 169 /** @private */
170 adapterStateChanged_: function() { 170 adapterStateChanged_: function() {
171 this.updateDeviceList_(); 171 this.updateDeviceList_();
172 }, 172 },
173 173
174 /** @private */ 174 /** @private */
175 deviceListChanged_: function() { 175 deviceListChanged_: function() {
176 var devices = this.$.devices; 176 this.saveScroll(this.$.devices);
177 this.pairedDeviceList_ = this.deviceList_.filter(function(device) { 177 this.pairedDeviceList_ = this.deviceList_.filter(function(device) {
178 return !!device.paired || !!device.connecting; 178 return !!device.paired || !!device.connecting;
179 }); 179 });
180 this.updateScrollableContents(); 180 this.updateScrollableContents();
181 this.restoreScroll(this.$.devices);
181 }, 182 },
182 183
183 /** @private */ 184 /** @private */
184 selectedItemChanged_: function() { 185 selectedItemChanged_: function() {
185 if (this.selectedItem_) 186 if (this.selectedItem_)
186 this.connectDevice_(this.selectedItem_); 187 this.connectDevice_(this.selectedItem_);
187 }, 188 },
188 189
189 /** 190 /**
190 * If bluetooth is enabled, request the complete list of devices and update 191 * If bluetooth is enabled, request the complete list of devices and update
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 this.startDiscovery_(); 407 this.startDiscovery_();
407 }, 408 },
408 409
409 /** @private */ 410 /** @private */
410 onDialogClosed_: function() { 411 onDialogClosed_: function() {
411 this.stopDiscovery_(); 412 this.stopDiscovery_();
412 this.dialogId_ = ''; 413 this.dialogId_ = '';
413 this.pairingDevice_ = undefined; 414 this.pairingDevice_ = undefined;
414 }, 415 },
415 }); 416 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698