webui.directive("textarea", function() {
  return {
    restrict: "E",
    link: function(scope, element) {
      element.attr(
        "placeholder",
        element.attr("placeholder").replace(/\\n/g, "\n")
      ).bind("keydown keypress", function(event) {
        if (event.ctrlKey && event.which === 13) {
          event.preventDefault();
          scope.$close();
        }
      });
    }
  };
});

webui.directive("textarea", function() {
  return {
    restrict: "E",
    link: function(scope, element) {
      element.attr(
        "placeholder",
        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();
          scope.$close();
        }
      });
    }
  };
});

Fix "Cannot read property 'replace' of undefined"
Fix "Cannot read property 'replace' of undefined"

Signed-off-by: kuoruan <2b8c98b0b69c0b74bfe03cced5a9f738a15f1468@gmail.com>
