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

Side by Side Diff: chrome/browser/resources/settings/global_scroll_target_behavior.js

Issue 1914653002: Make lists in the passwords section aware of the scroll target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview |GlobalScrollTargetBehavior| allows an element to be aware of
7 * the global scroll target. |scrollTarget| will be populated async by
8 * |setGlobalScrollTarget|. |setGlobalScrollTarget| should only be called once.
9 */
10
11 cr.define('settings', function() {
12 var scrollTargetResolver = new PromiseResolver();
13
14 /** @polymerBehavior */
15 var GlobalScrollTargetBehavior = {
16 properties: {
17 /**
18 * Read only property for the scroll target.
19 * @type {HTMLElement}
20 */
21 scrollTarget: {
22 type: Object,
23 readOnly: true,
24 },
25 },
26
27 /** @override */
28 attached: function() {
29 scrollTargetResolver.promise.then(this._setScrollTarget.bind(this));
30 },
31 };
32
33 /**
34 * This should only be called once.
35 * @param {HTMLElement} scrollTarget
36 */
37 var setGlobalScrollTarget = function(scrollTarget) {
38 scrollTargetResolver.resolve(scrollTarget);
39 };
40
41 return {
42 GlobalScrollTargetBehavior: GlobalScrollTargetBehavior,
43 setGlobalScrollTarget: setGlobalScrollTarget,
44 };
45 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698