|
@@ -58,11 +58,12 @@ export function isWidget( element ) {
|
|
|
* @returns {module:engine/view/element~Element} Returns same element.
|
|
* @returns {module:engine/view/element~Element} Returns same element.
|
|
|
*/
|
|
*/
|
|
|
export function toWidget( element, writer, options = {} ) {
|
|
export function toWidget( element, writer, options = {} ) {
|
|
|
- // The selection on Edge behaves better when whole editor contents is in single contentedible element.
|
|
|
|
|
|
|
+ // The selection on Edge behaves better when the whole editor contents is in a single contentedible element.
|
|
|
// https://github.com/ckeditor/ckeditor5/issues/1079
|
|
// https://github.com/ckeditor/ckeditor5/issues/1079
|
|
|
if ( !env.isEdge ) {
|
|
if ( !env.isEdge ) {
|
|
|
writer.setAttribute( 'contenteditable', 'false', element );
|
|
writer.setAttribute( 'contenteditable', 'false', element );
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
writer.addClass( WIDGET_CLASS_NAME, element );
|
|
writer.addClass( WIDGET_CLASS_NAME, element );
|
|
|
writer.setCustomProperty( widgetSymbol, true, element );
|
|
writer.setCustomProperty( widgetSymbol, true, element );
|
|
|
element.getFillerOffset = getFillerOffset;
|
|
element.getFillerOffset = getFillerOffset;
|
|
@@ -159,13 +160,13 @@ export function getLabel( element ) {
|
|
|
export function toWidgetEditable( editable, writer ) {
|
|
export function toWidgetEditable( editable, writer ) {
|
|
|
writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
|
|
writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
|
|
|
|
|
|
|
|
- // The selection on Edge behaves better when whole editor contents is in single contentedible element.
|
|
|
|
|
|
|
+ // The selection on Edge behaves better when the whole editor contents is in a single contentedible element.
|
|
|
// https://github.com/ckeditor/ckeditor5/issues/1079
|
|
// https://github.com/ckeditor/ckeditor5/issues/1079
|
|
|
if ( !env.isEdge ) {
|
|
if ( !env.isEdge ) {
|
|
|
// Set initial contenteditable value.
|
|
// Set initial contenteditable value.
|
|
|
writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
|
|
writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
|
|
|
|
|
|
|
|
- // Bind contenteditable property to element#isReadOnly.
|
|
|
|
|
|
|
+ // Bind the contenteditable property to element#isReadOnly.
|
|
|
editable.on( 'change:isReadOnly', ( evt, property, is ) => {
|
|
editable.on( 'change:isReadOnly', ( evt, property, is ) => {
|
|
|
writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
|
|
writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
|
|
|
} );
|
|
} );
|