Skip to content

Commit

Permalink
Update upcast for columns
Browse files Browse the repository at this point in the history
  • Loading branch information
occupant committed Jun 28, 2024
1 parent 16a05f9 commit 4b9c707
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion js/build/ubcColumnsFour.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/build/ubcColumnsThree.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/build/ubcColumnsTwo.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ function createUbcColumnsFour(writer) {
class: 'widget-column-options widget-columns-4 align-equal'
});
const firstColumn = writer.createElement('ubcColumnsFourColumn', {
class: 'widget-region-one'
class: 'widget-region-one first-child--mt-0'
});
const secondColumn = writer.createElement('ubcColumnsFourColumn', {
class: 'widget-region-two'
class: 'widget-region-two first-child--mt-0'
});
const thirdColumn = writer.createElement('ubcColumnsFourColumn', {
class: 'widget-region-three'
class: 'widget-region-three first-child--mt-0'
});
const fourthColumn = writer.createElement('ubcColumnsFourColumn', {
class: 'widget-region-four'
class: 'widget-region-four first-child--mt-0'
});
const wrapper = writer.createElement('ubcColumnsFourWrapper', defaultColumnsGapStyle, {
class: 'widget--md--grid'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ export default class UbcColumnsFourEditing extends Plugin {
// <ubcColumnsFourColumn> model, provided it is a child element of <ubcColumnsFour>,
// as required by the schema.
conversion.for('upcast').elementToElement({
model: 'ubcColumnsFourColumn',
model: (viewElement, { writer }) => {
return writer.createElement('ubcColumnsFourColumn', {
class: viewElement.getAttribute('class')
});
},
view: {
name: 'div',
classes: ['first-child--mt-0'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ function createUbcColumnsThree(writer) {
class: 'widget-column-options widget-columns-3'
});
const firstColumn = writer.createElement('ubcColumnsThreeColumn', {
class: 'widget-region-one'
class: 'widget-region-one first-child--mt-0'
});
const secondColumn = writer.createElement('ubcColumnsThreeColumn', {
class: 'widget-region-two'
class: 'widget-region-two first-child--mt-0'
});
const thirdColumn = writer.createElement('ubcColumnsThreeColumn', {
class: 'widget-region-three'
class: 'widget-region-three first-child--mt-0'
});
const wrapper = writer.createElement('ubcColumnsThreeWrapper', defaultColumnsGapStyle, {
class: 'widget--md--grid'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ export default class UbcColumnsThreeEditing extends Plugin {
// <ubcColumnsThreeColumn> model, provided it is a child element of <ubcColumnsThree>,
// as required by the schema.
conversion.for('upcast').elementToElement({
model: 'ubcColumnsThreeColumn',
model: (viewElement, { writer }) => {
return writer.createElement('ubcColumnsThreeColumn', {
class: viewElement.getAttribute('class')
});
},
view: {
name: 'div',
classes: ['first-child--mt-0'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ function createUbcColumnsTwo(writer) {
class: 'widget-column-options widget-columns-2'
});
const firstColumn = writer.createElement('ubcColumnsTwoColumn', {
class: 'widget-region-one'
class: 'widget-region-one first-child--mt-0'
});
const secondColumn = writer.createElement('ubcColumnsTwoColumn', {
class: 'widget-region-two'
class: 'widget-region-two first-child--mt-0'
});
const wrapper = writer.createElement('ubcColumnsTwoWrapper', defaultColumnsGapStyle, {
class: 'widget--md--grid'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ export default class UbcColumnsTwoEditing extends Plugin {
// <ubcColumnsTwoColumn> model, provided it is a child element of <ubcColumnsTwo>,
// as required by the schema.
conversion.for('upcast').elementToElement({
model: 'ubcColumnsTwoColumn',
model: (viewElement, { writer }) => {
return writer.createElement('ubcColumnsTwoColumn', {
class: viewElement.getAttribute('class')
});
},
view: {
name: 'div',
classes: ['first-child--mt-0'],
Expand Down

0 comments on commit 4b9c707

Please sign in to comment.