mask: radial-gradient(320px 320px at var(--x) var(--y), black 1%, transparent 40%);
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/translations/ru.js"></script>
<script>
const textarea = document.querySelector( '#editor' );
BalloonEditor.create( textarea , {
language: 'ru',
removePlugins: [ 'Table' ],
toolbar: [ 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote' ]
})
.then( editor => {
window.editor = editor;
editor.model.document.on( 'change:data', ( evt, data ) => {
console.log( data );
$('textarea#tickets-editor').html( editor.getData() );
} );
} )
.catch( error => {
console.error( 'There was a problem initializing the editor.', error );
} );
</script>
.then( editor => {...}
код добавить:.then( editor => {
window.editor = editor;
editor.model.document.on( 'change:data', ( evt, data ) => {
console.log( data );
$('textarea#tickets-editor').html( editor.getData() );
} );
} )
Post.getInitialProps = async ({query, req}) => {
//console.log(query);
if(!req){
return ({post: null})
}
const postApi = await fetch(`https://jsonplaceholder.typicode.com/posts/${query.id}`);
const post = await postApi.json();
//Получаем id пользователя
const userId = post.userId;
const userApi = await fetch(`https://jsonplaceholder.typicode.com/users/${userId}`);
const user = await userApi.json();
return ({post: post, name: user.username});
}
const first = document.querySelector('#first');
const second = document.querySelector('#second');
const hideOptions = {
1: [ '12', '14', '15' ],
2: [ '1', '11', '16' ],
};
first.addEventListener('change', function() {
Array.prototype.forEach.call(second, function(n) {
n.hidden = this.includes(n.value);
}, hideOptions[this.value] ?? []);
});
.hidden {
display: none;
}
first.onchange = e => {
const toHide = hideOptions[e.target.value];
for (const n of second) {
n.classList.toggle('hidden', toHide?.indexOf(n.value) > -1);
}
};