Skip to content

Commit

Permalink
[#350] - Each slide settings: 1st layers, buttons Lock and Preview, t…
Browse files Browse the repository at this point in the history
…itle, content, remove button
  • Loading branch information
pamelars86 committed Apr 22, 2021
1 parent 731046c commit ffbf010
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 46 deletions.
87 changes: 44 additions & 43 deletions src/js/src/map-blocks/storymap-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,49 +384,6 @@ const StoryMapEditor = ( {
}
} }
>
<span className="input-label">{ __( 'Title', 'jeo' ) }</span>
<CKEditor
atributo="meuatributo"
editor={ ClassicEditor }
data={ slide.title }
config={ editorConfig }
onChange={ ( event, editor ) => {
// Set role 'button' to editor element so it isn't affected by drag and drop events
editor.ui.getEditableElement().setAttribute('role', 'button')

setCurrentSlideIndex( index );

const oldSlides = [ ...attributes.slides ];
oldSlides[ index ].title = editor.getData();

setAttributes( {
...attributes,
slides: oldSlides,
} );
} }
/>
<span className="input-label">{ __(
'Content', 'jeo'
) }</span>
<CKEditor
editor={ ClassicEditor }
data={ slide.content }
config={ editorConfig }
onChange={ ( event, editor ) => {
// Set role 'button' to editor element so it isn't affected by drag and drop events
editor.ui.getEditableElement().setAttribute('role', 'button')

setCurrentSlideIndex( index );

const oldSlides = [ ...attributes.slides ];
oldSlides[ index ].content = editor.getData();

setAttributes( {
...attributes,
slides: oldSlides,
} );
} }
/>
<span className="input-label">{ __("Layers", "jeo") }</span>
<DragDropContext onDragEnd={ onDragEndLayers }>
<Droppable droppableId="droppable">
Expand Down Expand Up @@ -639,6 +596,50 @@ const StoryMapEditor = ( {
<span>{ __( 'Preview', 'jeo' ) }</span>
</div>
</Button>

<span className="input-label">{ __( 'Title', 'jeo' ) }</span>
<CKEditor
atributo="meuatributo"
editor={ ClassicEditor }
data={ slide.title }
config={ editorConfig }
onChange={ ( event, editor ) => {
// Set role 'button' to editor element so it isn't affected by drag and drop events
editor.ui.getEditableElement().setAttribute('role', 'button')

setCurrentSlideIndex( index );

const oldSlides = [ ...attributes.slides ];
oldSlides[ index ].title = editor.getData();

setAttributes( {
...attributes,
slides: oldSlides,
} );
} }
/>
<span className="input-label">{ __(
'Content', 'jeo'
) }</span>
<CKEditor
editor={ ClassicEditor }
data={ slide.content }
config={ editorConfig }
onChange={ ( event, editor ) => {
// Set role 'button' to editor element so it isn't affected by drag and drop events
editor.ui.getEditableElement().setAttribute('role', 'button')

setCurrentSlideIndex( index );

const oldSlides = [ ...attributes.slides ];
oldSlides[ index ].content = editor.getData();

setAttributes( {
...attributes,
slides: oldSlides,
} );
} }
/>
<Button
className="remove-button"
onClick={ () => {
Expand Down
6 changes: 3 additions & 3 deletions src/js/src/map-blocks/storymap-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
top: 50px;
padding: 10px;
left: calc(45% + 15px);

.title {
label {
font-weight: bold;
Expand Down Expand Up @@ -210,7 +210,7 @@
margin-top: 15px;
width: 100%;
background: rgb(240, 240, 240);
margin-top: 40px;

&:focus {
background: rgb(240, 240, 240);
}
Expand All @@ -228,7 +228,7 @@
}
}
.preview-button {
margin-top: 15px;
margin: 15px 0;
width: 100%;
background: rgb(240, 240, 240);
&:focus {
Expand Down

0 comments on commit ffbf010

Please sign in to comment.