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

Unified Diff: chrome/browser/resources/md_bookmarks/list.js

Issue 2834493006: MD Bookmarks: Pull context menu into separate element (Closed)
Patch Set: Switch back to using a Command enum Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_bookmarks/list.js
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js
index 5ee5454ff6110c8f05731a22a230561b7dc6f5f3..365487a55254e8aa6b0366b8384f00ed68f0fa64 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -10,9 +10,6 @@ Polymer({
],
properties: {
- /** @type {BookmarkNode} */
- menuItem_: Object,
-
/** @private {Array<string>} */
displayedList_: {
type: Array,
@@ -29,7 +26,6 @@ Polymer({
listeners: {
'click': 'deselectItems_',
- 'open-item-menu': 'onOpenItemMenu_',
},
attached: function() {
@@ -46,81 +42,6 @@ Polymer({
return this.$.message;
},
- /**
- * @param {Event} e
- * @private
- */
- onOpenItemMenu_: function(e) {
- this.menuItem_ = e.detail.item;
- var menu = /** @type {!CrActionMenuElement} */ (
- this.$.dropdown);
- if (e.detail.targetElement) {
- menu.showAt(/** @type {!Element} */ (e.detail.targetElement));
- } else {
- menu.showAtPosition({
- top: e.detail.y,
- left: e.detail.x,
- });
- }
- },
-
- /** @private */
- onEditTap_: function() {
- this.closeDropdownMenu_();
- /** @type {BookmarksEditDialogElement} */ (this.$.editDialog.get())
- .showEditDialog(this.menuItem_);
- },
-
- /** @private */
- onCopyURLTap_: function() {
- var idList = [this.menuItem_.id];
- chrome.bookmarkManagerPrivate.copy(idList, function() {
- // TODO(jiaxi): Add toast later.
- });
- this.closeDropdownMenu_();
- },
-
- /** @private */
- onDeleteTap_: function() {
- if (this.menuItem_.url) {
- chrome.bookmarks.remove(this.menuItem_.id, function() {
- // TODO(jiaxi): Add toast later.
- }.bind(this));
- } else {
- chrome.bookmarks.removeTree(this.menuItem_.id, function() {
- // TODO(jiaxi): Add toast later.
- }.bind(this));
- }
- this.closeDropdownMenu_();
- },
-
- /**
- * Close the menu on mousedown so clicks can propagate to the underlying UI.
- * This allows the user to right click the list while a context menu is
- * showing and get another context menu.
- * @param {Event} e
- * @private
- */
- onMenuMousedown_: function(e) {
- if (e.path[0] != this.$.dropdown)
- return;
-
- this.$.dropdown.close();
- },
-
- /** @private */
- closeDropdownMenu_: function() {
- var menu = /** @type {!CrActionMenuElement} */ (
- this.$.dropdown);
- menu.close();
- },
-
- /** @private */
- getEditActionLabel_: function() {
- var label = this.menuItem_.url ? 'menuEdit' : 'menuRename';
- return loadTimeData.getString(label);
- },
-
/** @private */
emptyListMessage_: function() {
var emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList';

Powered by Google App Engine
This is Rietveld 408576698