summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt3
-rw-r--r--fckeditor.module13
-rw-r--r--fckeditor.utils.js4
3 files changed, 13 insertions, 7 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f942018..ab20ed7 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,8 @@
$Id$
+-- 2008-12-04 version 6.x-1.x-dev
+* #341806 Fixed: Random problems with teaser break
+
-- 2008-12-01 version 6.x-1.x-dev
* #321818 Fixed: FCKeditor not displaying on any posts except initial ones
diff --git a/fckeditor.module b/fckeditor.module
index b557a32..b50b7c1 100644
--- a/fckeditor.module
+++ b/fckeditor.module
@@ -215,7 +215,7 @@ function fckeditor_process_form(&$form) {
$formats = element_children($element);
foreach ($formats as $format_id) {
- $format = $element[$format_id]['#default_value'];
+ $format = !empty($element[$format_id]['#default_value']) ? $element[$format_id]['#default_value'] : $element[$format_id]['#value'];
break;
}
@@ -1140,10 +1140,13 @@ function fckeditor_process_textarea($element) {
// if no popup mode, add the editor initialization to the footer
// this obviously needs print($closure) in page.tpl.php
if ($fckeditor_on && !$processed) {
- drupal_add_js('if (Drupal.jsEnabled) {$(document).ready(function() {if (typeof ('. $js_id .') != "undefined") {
- if ($("#edit-teaser-js").size() && $("#edit-teaser-js").val().length){
- $("#edit-body").val($("#edit-teaser-js").val() + "<!--break-->" + $("#edit-body").val());
- }
+ $str = "";
+ if ($element['#id'] == 'edit-body') {
+ $str = 'if ($("#edit-teaser-js").size() && $("#edit-teaser-js").val().length){
+ $("#edit-body").val($("#edit-teaser-js").val() + "<!--break-->" + $("#edit-body").val());
+ }';
+ }
+ drupal_add_js('if (Drupal.jsEnabled) {$(document).ready(function() {if (typeof ('. $js_id .') != "undefined") { '. $str .'
window.setTimeout("FCKeditorReplaceTextarea(\''. $textarea_id .'\','. $js_id .','. $xss_check .');",100);}});}', 'inline', 'footer');
}
}
diff --git a/fckeditor.utils.js b/fckeditor.utils.js
index 535f3d2..5617001 100644
--- a/fckeditor.utils.js
+++ b/fckeditor.utils.js
@@ -213,12 +213,12 @@ function FCKeditor_OnComplete( editorInstance )
if (oElem != null) {
oElem.style.display = '';
}
-
- editorInstance.LinkedField.form.onsubmit = doFCKeditorSave;
// If the textarea isn't visible update the content from the editor.
$(editorInstance.LinkedField.form).submit(DoFCKeditorTeaserStuff);
+ editorInstance.Events.AttachEvent( 'OnAfterLinkedFieldUpdate', DoFCKeditorTeaserStuff ) ;
+
var teaser = false;
var teaserCheckbox = false;