Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

t/66: Renamed .ck-widget_selectable to .ck-widget_with-selection-handler. #67

Merged
merged 1 commit into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,5 @@ function addSelectionHandler( editable, writer ) {

// Append the selection handler into the widget wrapper.
writer.insert( writer.createPositionAt( editable, 0 ), selectionHandler );
writer.addClass( [ 'ck-widget_selectable' ], editable );
writer.addClass( [ 'ck-widget_with-selection-handler' ], editable );
}
2 changes: 1 addition & 1 deletion tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe( 'widget utils', () => {
it( 'should add element a selection handler to widget if hasSelectionHandler=true is passed', () => {
toWidget( element, writer, { hasSelectionHandler: true } );

expect( element.hasClass( 'ck-widget_selectable' ) ).to.be.true;
expect( element.hasClass( 'ck-widget_with-selection-handler' ) ).to.be.true;

const selectionHandler = element.getChild( 0 );
expect( selectionHandler ).to.be.instanceof( UIElement );
Expand Down
32 changes: 16 additions & 16 deletions tests/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,11 +1236,11 @@ describe( 'Widget', () => {
viewDocument.fire( 'mousedown', domEventDataMock );

expect( getViewData( view ) ).to.equal(
'[<div class="ck-widget ck-widget_selectable ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'[<div class="ck-widget ck-widget_with-selection-handler ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck ck-widget__selection-handler"></div>' +
Expand Down Expand Up @@ -1268,19 +1268,19 @@ describe( 'Widget', () => {
viewDocument.fire( 'mousedown', domEventDataMock );

expect( getViewData( view ) ).to.equal(
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'[<div class="ck-widget ck-widget_selectable ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'[<div class="ck-widget ck-widget_with-selection-handler ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>]' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>'
);
Expand All @@ -1304,9 +1304,9 @@ describe( 'Widget', () => {
viewDocument.fire( 'mousedown', domEventDataMock );

expect( getViewData( view ) ).to.equal(
'[<div class="ck-widget ck-widget_selectable ck-widget_selected" contenteditable="false">' +
'[<div class="ck-widget ck-widget_with-selection-handler ck-widget_selected" contenteditable="false">' +
'<figcaption contenteditable="true">foo bar</figcaption>' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck ck-widget__selection-handler"></div>' +
Expand Down Expand Up @@ -1334,12 +1334,12 @@ describe( 'Widget', () => {
viewDocument.fire( 'mousedown', domEventDataMock );

expect( getViewData( view ) ).to.equal(
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'[<div class="ck-widget ck-widget_selectable ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'[<div class="ck-widget ck-widget_with-selection-handler ck-widget_selected" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>' +
'<div class="ck ck-widget__selection-handler"></div>' +
Expand All @@ -1364,9 +1364,9 @@ describe( 'Widget', () => {
viewDocument.fire( 'mousedown', domEventDataMock );

expect( getViewData( view ) ).to.equal(
'<div class="ck-widget ck-widget_selectable" contenteditable="false">' +
'<div class="ck-widget ck-widget_with-selection-handler" contenteditable="false">' +
'<figcaption contenteditable="true">' +
'[<div class="ck-widget ck-widget_selectable ck-widget_selected" contenteditable="false">' +
'[<div class="ck-widget ck-widget_with-selection-handler ck-widget_selected" contenteditable="false">' +
'<div class="ck ck-widget__selection-handler"></div>' +
'</div>]' +
'</figcaption>' +
Expand Down
2 changes: 1 addition & 1 deletion theme/widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

.ck .ck-widget.ck-widget_selectable {
.ck .ck-widget.ck-widget_with-selection-handler {
/* Make the widget wrapper a relative positioning container for the drag handler. */
position: relative;

Expand Down