diff options
| author | Martin Ridgers <[email protected]> | 2024-09-19 13:58:40 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2024-09-24 10:57:34 +0200 |
| commit | 4859016e1719b6ff2e5d820d7cb9be1fcf560e03 (patch) | |
| tree | bd6abd1b90ec7e12e6667ba5c6339c202c8c9e30 /src | |
| parent | Leave blank table cells empty (diff) | |
| download | zen-4859016e1719b6ff2e5d820d7cb9be1fcf560e03.tar.xz zen-4859016e1719b6ff2e5d820d7cb9be1fcf560e03.zip | |
Toolbars can be used within other elements
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/frontend/html/zen.css | 4 | ||||
| -rw-r--r-- | src/zenserver/frontend/html/zen.js | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/zenserver/frontend/html/zen.css b/src/zenserver/frontend/html/zen.css index 78037cc79..273e30739 100644 --- a/src/zenserver/frontend/html/zen.css +++ b/src/zenserver/frontend/html/zen.css @@ -104,6 +104,10 @@ h3 { margin-bottom: 0.6em; } +.zen_toolbar.zen_toolbar_inline { + margin: unset; +} + .zen_toolbar > div { display: flex; align-items: center; diff --git a/src/zenserver/frontend/html/zen.js b/src/zenserver/frontend/html/zen.js index 61a9ee29d..7b70c5d77 100644 --- a/src/zenserver/frontend/html/zen.js +++ b/src/zenserver/frontend/html/zen.js @@ -214,11 +214,14 @@ class Toolbar extends Component sep() { return this.tag().text("|").classify("zen_toolbar_sep"); } } - constructor(parent) + constructor(parent, inline=false) { var root = parent.tag().classify("zen_toolbar"); super(root); + if (inline) + root.classify("zen_toolbar_inline"); + this._left = new Toolbar.Side(root.tag()) this._right = new Toolbar.Side(root.tag()) } @@ -585,6 +588,13 @@ class Test extends Page side.add("tb_item2"); } + var cell = prop_table.add_property("toolbar", ""); + toolbar0 = new Toolbar(cell[1], true); + toolbar0.left().add("tbitem0"); + toolbar0.left().add("tbitem1"); + toolbar0.right().add("tbitem2"); + toolbar0.right().add("tbitem3"); + // error throw Error("deliberate error"); } |