| Index: chrome/browser/resources/md_bookmarks/toolbar.js
|
| diff --git a/chrome/browser/resources/md_bookmarks/toolbar.js b/chrome/browser/resources/md_bookmarks/toolbar.js
|
| index 8dacb67e248dd00b08ce2c8bf839a8644b9c973e..53a8d93be4ec360564b89f278bc5b2ea0d9fb2b2 100644
|
| --- a/chrome/browser/resources/md_bookmarks/toolbar.js
|
| +++ b/chrome/browser/resources/md_bookmarks/toolbar.js
|
| @@ -20,12 +20,26 @@ Polymer({
|
| type: String,
|
| observer: 'onSidebarWidthChanged_',
|
| },
|
| +
|
| + showSelectionOverlay: {
|
| + type: Boolean,
|
| + computed: 'shouldShowSelectionOverlay_(selectedCount_)',
|
| + readOnly: true,
|
| + reflectToAttribute: true,
|
| + },
|
| +
|
| + /** @private */
|
| + selectedCount_: Number,
|
| },
|
|
|
| attached: function() {
|
| this.watch('searchTerm_', function(state) {
|
| return state.search.term;
|
| });
|
| + this.watch('selectedCount_', function(state) {
|
| + return state.selection.items.size;
|
| + });
|
| + this.updateFromStore();
|
| },
|
|
|
| /** @return {CrToolbarSearchFieldElement} */
|
| @@ -58,6 +72,7 @@ Polymer({
|
| this.closeDropdownMenu_();
|
| },
|
|
|
| + /** @private */
|
| onAddFolderTap_: function() {
|
| var dialog =
|
| /** @type {BookmarksEditDialogElement} */ (this.$.addDialog.get());
|
| @@ -78,6 +93,11 @@ Polymer({
|
| },
|
|
|
| /** @private */
|
| + onClearSelectionTap_: function() {
|
| + this.dispatch(bookmarks.actions.deselectItems());
|
| + },
|
| +
|
| + /** @private */
|
| closeDropdownMenu_: function() {
|
| var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown);
|
| menu.close();
|
| @@ -93,6 +113,7 @@ Polymer({
|
| this.dispatch(bookmarks.actions.setSearchTerm(searchTerm));
|
| },
|
|
|
| + /** @private */
|
| onSidebarWidthChanged_: function() {
|
| this.style.setProperty('--sidebar-width', this.sidebarWidth);
|
| },
|
| @@ -109,4 +130,20 @@ Polymer({
|
| hasSearchTerm_: function() {
|
| return !!this.searchTerm_;
|
| },
|
| +
|
| + /**
|
| + * @return {boolean}
|
| + * @private
|
| + */
|
| + shouldShowSelectionOverlay_: function() {
|
| + return this.selectedCount_ > 1;
|
| + },
|
| +
|
| + /**
|
| + * @return {string}
|
| + * @private
|
| + */
|
| + numberOfItemsSelected_: function() {
|
| + return loadTimeData.getStringF('itemsSelected', this.selectedCount_);
|
| + },
|
| });
|
|
|