Merge pull request #344 from kuoruan/fix_replace
Fix "Cannot read property 'replace' of undefined"
This commit is contained in:
commit
a7a7cb30be
|
@ -4,7 +4,13 @@ webui.directive("textarea", function() {
|
|||
link: function(scope, element) {
|
||||
element.attr(
|
||||
"placeholder",
|
||||
element.attr("placeholder").replace(/\\n/g, "\n")
|
||||
function(index, placeholder) {
|
||||
if (placeholder !== undefined) {
|
||||
return placeholder.replace(/\\n/g, "\n");
|
||||
} else {
|
||||
return placeholder;
|
||||
}
|
||||
}
|
||||
).bind("keydown keypress", function(event) {
|
||||
if (event.ctrlKey && event.which === 13) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue
Block a user