diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-17 08:26:42 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-17 08:26:42 +0000 |
commit | 66f88efaae5bddab73c18879198130538d44fee8 (patch) | |
tree | 0f60394e694ea7c241976032cd2657618073724f /misc | |
parent | 6b040974d30b333d8ef284270d9fb78d764fc3e6 (diff) | |
download | brdo-66f88efaae5bddab73c18879198130538d44fee8.tar.gz brdo-66f88efaae5bddab73c18879198130538d44fee8.tar.bz2 |
- Patch #193577 by DamZ: fixed teaser splitting Javascript code.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/teaser.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/teaser.js b/misc/teaser.js index e8ee8061d..93043fdbe 100644 --- a/misc/teaser.js +++ b/misc/teaser.js @@ -68,10 +68,10 @@ Drupal.behaviors.teaser = { $(include).parent().parent().before(button); // Extract the teaser from the body, if set. Otherwise, stay in joined mode. - var text = body.val().split('<!--break-->', 2); - if (text.length == 2) { - teaser[0].value = trim(text[0]); - body[0].value = trim(text[1]); + var text = body.val().split('<!--break-->'); + if (text.length >= 2) { + teaser[0].value = trim(text.shift()); + body[0].value = trim(text.join('<!--break-->')); $(teaser).attr('disabled', ''); $('input', button).val(Drupal.t('Join summary')).toggle(join_teaser, split_teaser); } |