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

Side by Side Diff: chrome/browser/resources/md_history/app.crisper.js

Issue 2262993002: Fixes deleting history when there is only one item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes removing of single child top level history items. Created 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_list_behavior.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 function PromiseResolver() { 4 function PromiseResolver() {
5 this.resolve_; 5 this.resolve_;
6 this.reject_; 6 this.reject_;
7 this.promise_ = new Promise(function(resolve, reject) { 7 this.promise_ = new Promise(function(resolve, reject) {
8 this.resolve_ = resolve; 8 this.resolve_ = resolve;
9 this.reject_ = reject; 9 this.reject_ = reject;
10 }.bind(this)); 10 }.bind(this));
(...skipping 6829 matching lines...) Expand 10 before | Expand all | Expand 10 after
6840 var item = array.splice(index, 1); 6840 var item = array.splice(index, 1);
6841 splices.push({ 6841 splices.push({
6842 index: index, 6842 index: index,
6843 removed: [ item ], 6843 removed: [ item ],
6844 addedCount: 0, 6844 addedCount: 0,
6845 object: array, 6845 object: array,
6846 type: 'splice' 6846 type: 'splice'
6847 }); 6847 });
6848 } 6848 }
6849 }.bind(this)); 6849 }.bind(this));
6850 if (array.length == 0) return true; 6850 if (array.length == 0 && node.currentPath.indexOf('.') != -1) return true;
6851 this.notifySplices(node.currentPath, splices); 6851 this.notifySplices(node.currentPath, splices);
6852 return false; 6852 return false;
6853 }, 6853 },
6854 itemSelected_: function(e) { 6854 itemSelected_: function(e) {
6855 var item = e.detail.element; 6855 var item = e.detail.element;
6856 var paths = []; 6856 var paths = [];
6857 var itemPath = item.path; 6857 var itemPath = item.path;
6858 if (e.detail.shiftKey && this.lastSelectedPath) { 6858 if (e.detail.shiftKey && this.lastSelectedPath) {
6859 var itemPathComponents = itemPath.split('.'); 6859 var itemPathComponents = itemPath.split('.');
6860 var itemIndex = Number(itemPathComponents.pop()); 6860 var itemIndex = Number(itemPathComponents.pop());
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
8666 this.set('routeData_.page', selectedPage); 8666 this.set('routeData_.page', selectedPage);
8667 }, 8667 },
8668 getSelectedPage_: function(selectedPage, items) { 8668 getSelectedPage_: function(selectedPage, items) {
8669 return selectedPage; 8669 return selectedPage;
8670 }, 8670 },
8671 closeDrawer_: function() { 8671 closeDrawer_: function() {
8672 var drawer = this.$$('#drawer'); 8672 var drawer = this.$$('#drawer');
8673 if (drawer) drawer.close(); 8673 if (drawer) drawer.close();
8674 } 8674 }
8675 }); 8675 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_list_behavior.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698