src/widgets/Segments.js
branchnew-model
changeset 905 029a4efe9e24
parent 881 f11b234497f7
child 906 4b6e154ae8de
--- a/src/widgets/Segments.js	Fri May 18 18:23:51 2012 +0200
+++ b/src/widgets/Segments.js	Mon May 21 13:17:47 2012 +0200
@@ -42,9 +42,10 @@
         segments : _list.map(function(_annotation, _k) {
             var _left = _annotation.begin * _scale,
                 _width = ( _annotation.end - _annotation.begin ) * _scale,
-                _center = _left + _width / 2;
+                _center = _left + _width / 2,
+                _fulltext = _annotation.title + ( _annotation.description ? ( '<br/>' + _annotation.description ) : '' );
             return {
-                text : _annotation.title + ( _annotation.description ? '<br />' + _annotation.description.replace(/(^.{120,140})[\s].+$/,'$1&hellip;') : ''),
+                text : _fulltext.replace(/(^.{120,140})[\s].+$/,'$1&hellip;'),
                 color : ( typeof _annotation.color !== "undefined" && _annotation.color ? _annotation.color : _this.colors[_k % _this.colors.length] ),
                 beginseconds : _annotation.begin.getSeconds() ,
                 left : Math.floor( _left ),