Browse Source

make editor scale with the page nicely

pull/1/head
wes 8 years ago
parent
commit
d294057e30
  1. 15
      src/scripts/editor.tag
  2. 4
      src/styles/riotblog.scss
  3. 2
      src/templates/write.html

15
src/scripts/editor.tag

@ -5,11 +5,11 @@
<textarea onfocus={clearplaceholder} <textarea onfocus={clearplaceholder}
onblur={checkplaceholder} onblur={checkplaceholder}
oninput={echo} oninput={echo}
rows="30"
cols="10"
__disabled={""} __disabled={""}
class="form-input editor centered" class="editor form-input centered"
ref="textarea" ref="textarea"
rows="10"
cols="50"
maxlength={this.maxlength}> maxlength={this.maxlength}>
{ placeholder } { placeholder }
</textarea> </textarea>
@ -18,9 +18,11 @@
Submit Post Submit Post
</button> </button>
</div> </div>
<div class="column col-6"> <div class="column col-6">
<raw content="{this.converted}"></raw> <raw content="{this.converted}"></raw>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
@ -56,8 +58,11 @@ checkplaceholder() {
} }
echo(ev) { echo(ev) {
this.update({"converted" : this.converter.makeHtml(this.refs.textarea.value)}); this.update({
console.log("tried updating the raw tag"); "converted" : this.converter.makeHtml(
this.refs.textarea.value.trim()
)
});
} }
var self = this; var self = this;

4
src/styles/riotblog.scss

@ -86,4 +86,6 @@
margin-top: 10%; margin-top: 10%;
} }
.editor {} .editor {
height: 100% !important;
}

2
src/templates/write.html

@ -22,7 +22,7 @@
{% block styles %} {% block styles %}
<link rel="stylesheet" href="/blog/styles/spectre.min.css"> <link rel="stylesheet" href="/blog/styles/spectre.min.css">
<link rel="stylesheet" href="/blog/styles/blog.min.css"> <link rel="stylesheet" href="/blog/styles/riotblog.min.css">
{% endblock %} {% endblock %}

Loading…
Cancel
Save