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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js

Issue 2605253002: [DevTools] Add grow mode to ListControl. (Closed)
Patch Set: works Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 if (asyncDetails) 379 if (asyncDetails)
380 this._asyncDetailsCallback = item => asyncDetails(completions.indexOf(it em)); 380 this._asyncDetailsCallback = item => asyncDetails(completions.indexOf(it em));
381 else 381 else
382 this._asyncDetailsCallback = null; 382 this._asyncDetailsCallback = null;
383 this._userEnteredText = userEnteredText; 383 this._userEnteredText = userEnteredText;
384 384
385 this._show(); 385 this._show();
386 this._updateBoxPosition(anchorBox, completions.length); 386 this._updateBoxPosition(anchorBox, completions.length);
387 this._updateWidth(completions); 387 this._updateWidth(completions);
388 388
389 this._list.setHeightMode(UI.ListHeightMode.Fixed); 389 this._list.setMode(UI.ListMode.ViewportFixedItems);
caseq 2016/12/29 19:25:31 let's have a dedicated method to reset height?
390 this._list.replaceAllItems(completions); 390 this._list.replaceAllItems(completions);
391 391
392 var highestPriorityItem = -1; 392 var highestPriorityItem = -1;
393 if (selectHighestPriority) { 393 if (selectHighestPriority) {
394 var highestPriority = -Infinity; 394 var highestPriority = -Infinity;
395 for (var i = 0; i < completions.length; i++) { 395 for (var i = 0; i < completions.length; i++) {
396 var priority = completions[i].priority || 0; 396 var priority = completions[i].priority || 0;
397 if (highestPriority < priority) { 397 if (highestPriority < priority) {
398 highestPriority = priority; 398 highestPriority = priority;
399 highestPriorityItem = i; 399 highestPriorityItem = i;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 this.element.style.left = containerBox.x + 'px'; 506 this.element.style.left = containerBox.x + 'px';
507 this.element.style.top = containerBox.y + 'px'; 507 this.element.style.top = containerBox.y + 'px';
508 this.element.style.height = containerBox.height + 'px'; 508 this.element.style.height = containerBox.height + 'px';
509 this.element.style.width = containerBox.width + 'px'; 509 this.element.style.width = containerBox.width + 'px';
510 } 510 }
511 511
512 dispose() { 512 dispose() {
513 this.element.remove(); 513 this.element.remove();
514 } 514 }
515 }; 515 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698