Skip to content

Commit

Permalink
Merge branch 't/11811b'
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed May 12, 2014
2 parents 11e6c22 + 75a81ec commit edf271d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -29,6 +29,7 @@ Fixed Issues:
* [#11798](http://dev.ckeditor.com/ticket/11798): Fixed: Inserting non-editable element inside a table cell breaks the table badly.
* [#11793](http://dev.ckeditor.com/ticket/11793): Fixed: Drop down is not "on" when clicking it while editor is blurred.
* [#11850](http://dev.ckeditor.com/ticket/11850): Fixed: Filter downcasting fake object to element it replaced is not applied if fake object element is non-editable.
* [#11811](http://dev.ckeditor.com/ticket/11811): Fixed: Widget's data are not encoded correctly when passed to attribute.

Other changes:

Expand Down
6 changes: 3 additions & 3 deletions plugins/widget/plugin.js
Expand Up @@ -1868,7 +1868,7 @@
element = upcasted;

// Set initial data attr with data from upcast method.
element.attributes[ 'data-cke-widget-data' ] = JSON.stringify( data );
element.attributes[ 'data-cke-widget-data' ] = encodeURIComponent( JSON.stringify( data ) );
element.attributes[ 'data-cke-widget-upcasted' ] = 1;

toBeWrapped.push( [ element, upcast[ 1 ] ] );
Expand Down Expand Up @@ -3091,7 +3091,7 @@
var widgetDataAttr = widget.element.data( 'cke-widget-data' );

if ( widgetDataAttr )
widget.setData( JSON.parse( widgetDataAttr ) );
widget.setData( JSON.parse( decodeURIComponent( widgetDataAttr ) ) );
if ( startupData )
widget.setData( startupData );

Expand All @@ -3116,7 +3116,7 @@
}

function writeDataToElement( widget ) {
widget.element.data( 'cke-widget-data', JSON.stringify( widget.data ) );
widget.element.data( 'cke-widget-data', encodeURIComponent( JSON.stringify( widget.data ) ) );
}

//
Expand Down

0 comments on commit edf271d

Please sign in to comment.