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/shared/js/cr/ui/tree.js

Issue 7711019: BMM: Fix for add a page UI has very tiny input fields (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/bmm/bookmark_list.js ('k') | 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 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 // require cr.ui.define 6 // require cr.ui.define
7 // require cr.ui.limitInputWidth 7 // require cr.ui.limitInputWidth
8 8
9 /** 9 /**
10 * The number of pixels to indent per level. 10 * The number of pixels to indent per level.
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 var eventsToStop = ['mousedown', 'mouseup', 'contextmenu', 'dblclick']; 564 var eventsToStop = ['mousedown', 'mouseup', 'contextmenu', 'dblclick'];
565 eventsToStop.forEach(function(type) { 565 eventsToStop.forEach(function(type) {
566 input.addEventListener(type, stopPropagation); 566 input.addEventListener(type, stopPropagation);
567 }); 567 });
568 568
569 // Wait for the input element to recieve focus before sizing it. 569 // Wait for the input element to recieve focus before sizing it.
570 var rowElement = this.rowElement; 570 var rowElement = this.rowElement;
571 function onFocus() { 571 function onFocus() {
572 input.removeEventListener('focus', onFocus); 572 input.removeEventListener('focus', onFocus);
573 // 20 = the padding and border of the tree-row 573 // 20 = the padding and border of the tree-row
574 cr.ui.limitInputWidth(input, rowElement, 20); 574 cr.ui.limitInputWidth(input, rowElement, 100);
575 } 575 }
576 input.addEventListener('focus', onFocus); 576 input.addEventListener('focus', onFocus);
577 input.focus(); 577 input.focus();
578 input.select(); 578 input.select();
579 579
580 this.oldLabel_ = text; 580 this.oldLabel_ = text;
581 } else { 581 } else {
582 this.removeAttribute('editing'); 582 this.removeAttribute('editing');
583 this.draggable = true; 583 this.draggable = true;
584 input = labelEl.firstChild; 584 input = labelEl.firstChild;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } 656 }
657 return item; 657 return item;
658 } 658 }
659 659
660 // Export 660 // Export
661 return { 661 return {
662 Tree: Tree, 662 Tree: Tree,
663 TreeItem: TreeItem 663 TreeItem: TreeItem
664 }; 664 };
665 }); 665 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/bmm/bookmark_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698