Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 't/9693'
  • Loading branch information
Reinmar committed Dec 7, 2012
2 parents 2112bc4 + a4a796d commit 205c30e
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions plugins/uicolor/dialogs/uicolor.js
Expand Up @@ -18,9 +18,8 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) {
picker.refresh( pickerId );
}

function setNewUiColor( color, force ) {
if ( force || dialog._.contents.tab1.livePeview.getValue() )
editor.setUiColor( color );
function setNewUiColor( color ) {
editor.setUiColor( color );
// Write new config string into textbox.
dialog._.contents.tab1.configBox.setValue( 'config.uiColor = "#' + picker.get( "hex" ) + '"' );
}
Expand All @@ -42,6 +41,9 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) {
}
});

// Make Yahoo widget available to public.
this.picker = picker;

// Set actual UI color to the picker.
if ( uiColor )
setNewPickerColor( uiColor );
Expand All @@ -60,8 +62,6 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) {
}
};

var skipPreviewChange = true;

return {
title: editor.lang.uicolor.title,
minWidth: 360,
Expand All @@ -87,22 +87,6 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) {
id: 'tab1',
type: 'vbox',
children: [
{
id: 'livePeview',
type: 'checkbox',
label: editor.lang.uicolor.preview,
'default': 1,
onLoad: function() {
skipPreviewChange = true;
},
onChange: function() {
if ( skipPreviewChange )
return;
var on = this.getValue(),
color = on ? '#' + picker.get( 'hex' ) : uiColor;
setNewUiColor( color, true );
}
},
{
type: 'hbox',
children: [
Expand Down

0 comments on commit 205c30e

Please sign in to comment.