Skip to content

Commit 19bae75

Browse files
committed
Ensure layout blocks have a default ratio
1 parent c081509 commit 19bae75

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

5-
## Version 0.12.0
5+
## Version 0.12.1
66

77
New Campaign Block Editor 📝
88

assets/js/campaign-editors/block/blocks/layout/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const _requiredClasses = "grid-cols-2 grid-cols-3 col-span-1 col-span-2 col-span
55

66
export default class Layout {
77
constructor({ data, config, api, block }) {
8-
this.data = data.blocks ? data : { blocks: [], columns: 2 }
8+
this.data = data.blocks && data.ratio ? data : { blocks: [], columns: 2, ratio: "1-1" }
99
this.editors = []
1010
this.config = config
1111

@@ -21,7 +21,7 @@ export default class Layout {
2121

2222
drawView() {
2323
this.wrapper.innerHTML = ""
24-
const colSpans = (this.data.ratio || "1-1").split("-").map(colSpan => parseInt(colSpan))
24+
const colSpans = this.data.ratio.split("-").map(colSpan => parseInt(colSpan))
2525
const colSpanTotal = colSpans.reduce((acc, i) => acc + i)
2626
this.wrapper.className = `layout-block grid grid-cols-${colSpanTotal} gap-4`
2727
this.editors = []

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Keila.MixProject do
44
def project do
55
[
66
app: :keila,
7-
version: "0.12.0",
7+
version: "0.12.1",
88
elixir: "~> 1.14",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
compilers: [:phoenix] ++ Mix.compilers(),

0 commit comments

Comments
 (0)