X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fcolorbutton%2Fplugin.js;h=77c002ad2acdf1d82401349e016c8615c325d423;hb=refs%2Ftags%2Fv3.5.3;hp=0fb8c05e43d8ab7ffe8425ffb1fe710d617a7cc1;hpb=9afde8772159bd3436f1f5b7862960307710ae5a;p=ckeditor.git diff --git a/_source/plugins/colorbutton/plugin.js b/_source/plugins/colorbutton/plugin.js index 0fb8c05..77c002a 100644 --- a/_source/plugins/colorbutton/plugin.js +++ b/_source/plugins/colorbutton/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -66,14 +66,14 @@ CKEDITOR.plugins.add( 'colorbutton', color; // Find the closest block element. - block = path.block || path.blockLimit; + block = path.block || path.blockLimit || editor.document.getBody(); // The background color might be transparent. In that case, look up the color in the DOM tree. do { color = block && block.getComputedStyle( type == 'back' ? 'background-color' : 'color' ) || 'transparent'; } - while ( type == 'back' && color == 'transparent' && ( block = block.getParent() ) ); + while ( type == 'back' && color == 'transparent' && block && ( block = block.getParent() ) ); // The box should never be transparent. if ( !color || color == 'transparent' ) @@ -220,7 +220,7 @@ CKEDITOR.plugins.add( 'colorbutton', function isUnstylable( ele ) { - return ( ele.getAttribute( 'contentEditable' ) == 'false' ) || ele.getAttribute( 'data-cke-nostyle' ); + return ( ele.getAttribute( 'contentEditable' ) == 'false' ) || ele.getAttribute( 'data-nostyle' ); } } });