From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../app/component_ui/mail_items.js | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js (limited to 'third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js') diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js b/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js new file mode 100644 index 0000000000..29b5cfd665 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js @@ -0,0 +1,61 @@ +'use strict'; + +define( + + [ + 'flight/lib/component', + './with_select' + ], + + function(defineComponent, withSelect) { + + return defineComponent(mailItems, withSelect); + + function mailItems() { + + this.defaultAttrs({ + deleteFolder: 'trash', + selectedClass: 'selected', + allowMultiSelect: true, + selectionChangedEvent: 'uiMailItemSelectionChanged', + selectedMailItems: [], + selectedFolders: [], + //selectors + itemSelector: 'tr.mail-item', + selectedItemSelector: 'tr.mail-item.selected' + }); + + this.renderItems = function(ev, data) { + this.select('itemContainerSelector').html(data.markup); + //new items, so no selections + this.trigger('uiMailItemSelectionChanged', {selectedIds: []}); + } + + this.updateMailItemSelections = function(ev, data) { + this.attr.selectedMailItems = data.selectedIds; + } + + this.updateFolderSelections = function(ev, data) { + this.attr.selectedFolders = data.selectedIds; + } + + this.requestDeletion = function() { + this.trigger('uiMoveItemsRequested', { + itemIds: this.attr.selectedMailItems, + fromFolder: this.attr.selectedFolders[0], + toFolder: this.attr.deleteFolder + }); + }; + + this.after('initialize', function() { + this.on(document, 'dataMailItemsServed', this.renderItems); + this.on(document, 'uiDeleteMail', this.requestDeletion); + + this.on('uiMailItemSelectionChanged', this.updateMailItemSelections); + this.on(document, 'uiFolderSelectionChanged', this.updateFolderSelections); + + this.trigger('uiMailItemsRequested'); + }); + } + } +); -- cgit v1.2.3