1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-20 06:56:40 +02:00
keeweb/app/scripts/views/fields/field-view-read-only.js

15 lines
384 B
JavaScript
Raw Normal View History

2019-09-15 14:16:32 +02:00
import { FieldView } from 'views/fields/field-view';
2019-09-18 07:08:23 +02:00
import { escape } from 'util/fn';
2015-10-17 23:49:24 +02:00
2019-09-16 19:55:06 +02:00
class FieldViewReadOnly extends FieldView {
readonly = true;
2019-08-18 10:17:09 +02:00
renderValue(value) {
2019-09-18 07:08:23 +02:00
value = value.isProtected ? new Array(value.textLength + 1).join('•') : escape(value);
value = value.replace(/\n/g, '<br/>');
return value;
2019-09-16 19:55:06 +02:00
}
}
2015-10-17 23:49:24 +02:00
2019-09-15 14:16:32 +02:00
export { FieldViewReadOnly };