Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit d9a9176

Browse files
Allow setting arbitrary attributes on display sheets.
This can be used to e.g. set event handlers or such for the faux-modals we use for confirmation dialogs and such.
1 parent 573c274 commit d9a9176

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/depject/sheet/display.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ exports.gives = nest('sheet.display')
55

66
exports.create = function () {
77
return nest('sheet.display', function (handler) {
8-
const { content, footer, classList, onMount } = handler(done)
8+
const { content, footer, classList, onMount, attributes } = handler(done)
99

10-
const container = h('div', { className: 'Sheet', classList }, [
10+
let fullAttributes = { className: 'Sheet', classList }
11+
if (attributes !== undefined) {
12+
fullAttributes = { ...attributes, ...fullAttributes }
13+
}
14+
const container = h('div', fullAttributes, [
1115
h('section', [content]),
1216
h('footer', [footer])
1317
])

0 commit comments

Comments
 (0)