Skip to content

Instantly share code, notes, and snippets.

@oleq
Last active January 19, 2017 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleq/77923dc1f31f83db729e9a93c580ca86 to your computer and use it in GitHub Desktop.
Save oleq/77923dc1f31f83db729e9a93c580ca86 to your computer and use it in GitHub Desktop.
UI logger for CKEditor5
window.logUi = ( view ) => {
console.group( `%c ${ view.constructor.name}`, 'color: green' );
console.log( 'element', view.element );
for ( let col of view._viewCollections ) {
const isUnbound = col === view._unboundChildren;
const isEmpty = !col.length;
console[ isEmpty ? 'groupCollapsed' : 'group' ]( `%c ViewCollection (${ col.length }) ${ isUnbound ? '(unbound)' : '' }`, `color: ${ isEmpty? 'rgba(0,0,0,.3)' : 'black' }` );
if ( !isUnbound ) {
console.log( '_parentElement', col._parentElement );
}
for ( let view of col ) {
logUi( view );
}
console.groupEnd();
}
console.groupEnd();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment