From 037d8ec85f792113219ba08959b147580abb045d Mon Sep 17 00:00:00 2001 From: luigser Date: Tue, 27 Oct 2015 17:35:09 +0100 Subject: [PATCH] selection controllet and card update --- controllets/create-card-controllet/create-card-controllet.html | 58 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/controllets/create-card-controllet/create-card-controllet.html b/controllets/create-card-controllet/create-card-controllet.html index ef40a12..ddbc341 100644 --- a/controllets/create-card-controllet/create-card-controllet.html +++ b/controllets/create-card-controllet/create-card-controllet.html @@ -4,6 +4,7 @@ + @@ -171,7 +172,6 @@ label="" char-counter max-rows="6" - rows="6" maxlength="1024" value="{{text}}"> @@ -204,16 +204,7 @@ -
- - -
+
@@ -234,15 +225,28 @@ title:{ type: String, - value: "Title" + value: "Title", + observer : '_valueChanged' + }, + text:{ + type: String, + value: "Text content", + observer : '_valueChanged' }, content:{ type: String, - value: undefined + value: undefined, + observer : '_valueChanged' }, comment:{ type: String, - value: "comment" + value: "comment", + observer : '_valueChanged' + }, + + timer :{ + type: Number, + value : 0 } }, @@ -256,6 +260,32 @@ _handleFabClick: function(e){ this.fire('create-card-controllet_button-clicked', {data : this}); + }, + + _valueChanged: function(oldvalue, newValue) { + var card = ''; + if(this.type == 'link'){ + card += ''; + }else{ + card += this.text; + } + + card += ''; + + clearTimeout (this.timer); + //Firefox stuff + var _this = this; + this.timer = setTimeout(function(){ + _this.$.card_preview.innerHTML = card; + }, 1000); + + } }) -- libgit2 0.21.4