projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb91b48
)
strip whitespace before and after value
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 27 May 2010 10:14:24 +0000
(12:14 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 27 May 2010 10:14:24 +0000
(12:14 +0200)
This gets somehow generated when I try to access table element using
jQuery.text() on it
public/edit_table.js
patch
|
blob
|
history
diff --git
a/public/edit_table.js
b/public/edit_table.js
index
34fa44c
..
89c202a
100644
(file)
--- a/
public/edit_table.js
+++ b/
public/edit_table.js
@@
-41,7
+41,11
@@
var cell_click = function(event) {
, event
, $(this).text()
);
- var content = $(this).text(); // we don't want para markup
+ var content = $(this).text() // we don't want para markup
+ .replace(/^[ \n\r]+/,'')
+ .replace(/[ \n\r]+$/,'')
+ ;
+console.debug( 'content', content );
var rows = content.split('ΒΆ').length * 2 + 1;
var textarea = $('<textarea rows='+rows+'/>');
textarea.val( content );