diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:30:55 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:30:55 +0100 |
| commit | 8631c4ba8e68fc6d29962597cc86ff06606037a5 (patch) | |
| tree | 96038ee2b31d6c411ce4d92551bcea4bb7e39e2b /public/assets/js/lib/views/index | |
| parent | 6a902c4dd6af4a903f80477fa05f9e698e8f2144 (diff) | |
more on profile
Diffstat (limited to 'public/assets/js/lib/views/index')
| -rw-r--r-- | public/assets/js/lib/views/index/threadbox.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js index 01d1de4..157b672 100644 --- a/public/assets/js/lib/views/index/threadbox.js +++ b/public/assets/js/lib/views/index/threadbox.js @@ -9,6 +9,7 @@ var ThreadBox = View.extend({ this.template = this.$(".template").html() this.keywordTemplate = this.$(".keywordTemplate").html() this.welcomeTemplate = this.$(".welcomeTemplate").html() + this.profileTemplate = this.$(".profileTemplate").html() }, load: function(data){ @@ -19,6 +20,10 @@ var ThreadBox = View.extend({ this.appendKeyword(data.keyword) this.appendThreads(data.threads) } + else if (data.user) { + this.appendProfile(data.user) + this.appendThreads(data.threads) + } else { if (this.options.latest) { var latest = data.threads.sort( (a,b) => { @@ -123,4 +128,8 @@ var ThreadBox = View.extend({ this.$el.append(this.welcomeTemplate) }, + appendProfile: function(user){ + this.$el.append(this.profileTemplate.replace(/{{username}}/g, user.username)) + }, + }) |
