|
@@ -371,8 +371,10 @@ zss_editor.setFontFamily = function(fontFamily) {
|
371
|
371
|
}
|
372
|
372
|
|
373
|
373
|
zss_editor.setTextColor = function(color) {
|
374
|
|
-
|
375
|
|
- zss_editor.restorerange();
|
|
374
|
+
|
|
375
|
+ if(zss_editor.currentSelection) {
|
|
376
|
+ zss_editor.restorerange();
|
|
377
|
+ }
|
376
|
378
|
document.execCommand("styleWithCSS", null, true);
|
377
|
379
|
document.execCommand('foreColor', false, color);
|
378
|
380
|
document.execCommand("styleWithCSS", null, false);
|
|
@@ -382,7 +384,10 @@ zss_editor.setTextColor = function(color) {
|
382
|
384
|
}
|
383
|
385
|
|
384
|
386
|
zss_editor.setBackgroundColor = function(color) {
|
385
|
|
- zss_editor.restorerange();
|
|
387
|
+
|
|
388
|
+ if(zss_editor.currentSelection) {
|
|
389
|
+ zss_editor.restorerange();
|
|
390
|
+ }
|
386
|
391
|
document.execCommand("styleWithCSS", null, true);
|
387
|
392
|
document.execCommand('hiliteColor', false, color);
|
388
|
393
|
document.execCommand("styleWithCSS", null, false);
|