Refactor to not repeat lots of Jinja code

This commit is contained in:
Chris Hill-Scott
2018-08-20 15:03:58 +01:00
parent b73e42650d
commit 6501105768
4 changed files with 14 additions and 32 deletions

View File

@@ -9,7 +9,10 @@
this.start = component => {
this.$input = $('input', component);
this.$preview = $('.textbox-colour-preview', component);
$(component).append(
this.$preview = $('<span class="textbox-colour-preview"></span>')
);
this.$input
.on('change keyup', this.update)