Last active
January 19, 2017 10:06
-
-
Save oleq/77923dc1f31f83db729e9a93c580ca86 to your computer and use it in GitHub Desktop.
UI logger for CKEditor5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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