diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index e3d316b7236..a0d7e36cd20 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -3891,11 +3891,26 @@ group = styleGroups[ widgetName ][ groupName ]; // Don't push style if it's already stored (#589). - if ( !CKEDITOR.tools.array.find( group, getCompareFn( style ) ) ) { + if ( !find( group, getCompareFn( style ) ) ) { group.push( style ); } } + // Copied `CKEDITOR.tools.array` from major branch. + function find( array, fn, thisArg ) { + var length = array.length, + i = 0; + + while ( i < length ) { + if ( fn.call( thisArg, array[ i ], i, array ) ) { + return array[ i ]; + } + i++; + } + + return undefined; + } + function getCompareFn( left ) { return function( right ) { return deepCompare( left.getDefinition(), right.getDefinition() );