Refactor edit textarea into gr-default-editor Done to keep with the event-based pattern of keeping track of edits, as opposed to the existing mechanism of two-way databinding. Bug: Issue 4437 Change-Id: Iec35538d9d163a983ecd405e4cd52ab5a41d7772
diff --git a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.html b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.html index 3042e76..1dade20 100644 --- a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.html +++ b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.html
@@ -26,9 +26,9 @@ <link rel="import" href="../../shared/gr-editable-label/gr-editable-label.html"> <link rel="import" href="../../shared/gr-fixed-panel/gr-fixed-panel.html"> <link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html"> +<link rel="import" href="../gr-default-editor/gr-default-editor.html"> <link rel="import" href="../../../styles/shared-styles.html"> - <dom-module id="gr-editor-view"> <template> <style include="shared-styles"> @@ -54,19 +54,6 @@ .textareaWrapper { margin: var(--default-horizontal-margin); } - .textareaWrapper textarea { - border: 1px solid #ddd; - border-radius: 3px; - box-sizing: border-box; - font-family: var(--monospace-font-family); - min-height: 60vh; - resize: none; - white-space: pre; - width: 100%; - } - .textareaWrapper textarea:focus { - outline: none; - } .textareaWrapper .editButtons { display: none; } @@ -100,7 +87,7 @@ <gr-endpoint-param name="fileContent" value="[[_newContent]]"></gr-endpoint-param> <gr-endpoint-param name="prefs" value="[[_prefs]]"></gr-endpoint-param> <gr-endpoint-param name="fileType" value="[[_type]]"></gr-endpoint-param> - <textarea value="{{_newContent::input}}" id="file"></textarea> + <gr-default-editor id="file" file-content="[[_newContent]]"></gr-default-editor> </gr-endpoint-decorator> </div> <gr-rest-api-interface id="restAPI"></gr-rest-api-interface>