webui-aria2/js/directives/textarea.js
Sergei Morozov 24d3e25126 getUris dialog improvements
This patch resolves #295 by making the Download Settings fieldset collapsed by default and moving the examples of URIs in textarea into the placeholder of textarea itself.

It also allows form submission when textarea is focused by pressing Ctrl+Enter.
2017-01-08 14:47:22 -08:00

17 lines
406 B
JavaScript

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();
}
});
}
};
});