Download:
child 259:81cfb42fdbfa
parent 257:32ad4a9536af
258:1e17308f127d
Anton Shestakov <av6@dwimlabs.net>, Mon, 12 Dec 2016 18:00:04 +0800
messages: rename rivets.bind() parameter

4 файлов изменено, 16 вставок(+), 16 удалений(-) [+]
coffee/messages.coffee file | annotate | diff | comparison | revisions
index.html file | annotate | diff | comparison | revisions
js/messages.js file | annotate | diff | comparison | revisions
js/messages.js.map file | annotate | diff | comparison | revisions
--- a/coffee/messages.coffee Fri Dec 09 13:23:03 2016 +0800
+++ b/coffee/messages.coffee Mon Dec 12 18:00:04 2016 +0800
@@ -75,7 +75,7 @@
@model.get('contact')?.get('d/handle') or @model.get('from')
render: (model) ->
- @rivet = rivets.bind(@el, model: @model, view: @)
+ @rivet = rivets.bind(@el, message: @model, view: @)
contact = @model.get('contact')
if contact
@av = new Tram.AvatarView(model: contact)
--- a/index.html Fri Dec 09 13:23:03 2016 +0800
+++ b/index.html Mon Dec 12 18:00:04 2016 +0800
@@ -244,25 +244,25 @@
</div>
</script>
<script type="text/template" id="message-template">
- <div class="message" rv-data-id="model:id">
- <div class="splitter" rv-if="model:d/split"></div>
- <div class="column avatar-column" rv-class-uk-invisible="model:d/fold"></div>
+ <div class="message" rv-data-id="message:id">
+ <div class="splitter" rv-if="message:d/split"></div>
+ <div class="column avatar-column" rv-class-uk-invisible="message:d/fold"></div>
<div class="column text-column">
- <div rv-hide="model:d/fold">
- <strong>{ view.getHandle < model:contact:d/handle model:from }</strong>
+ <div rv-hide="message:d/fold">
+ <strong>{ view.getHandle < message:contact:d/handle message:from }</strong>
</div>
- <div rv-class="model:cls">
+ <div rv-class="message:cls">
<span class="uk-float-right uk-text-muted">
- <i class="uk-icon-pencil" rv-if="model:corrected" title="Edited (XEP-0308)"></i>
- <i class="uk-icon-files-o" rv-if="model:carbon" title="Carbon (XEP-0280)"></i>
+ <i class="uk-icon-pencil" rv-if="message:corrected" title="Edited (XEP-0308)"></i>
+ <i class="uk-icon-files-o" rv-if="message:carbon" title="Carbon (XEP-0280)"></i>
<time class="stamp"
- rv-datetime="model:d/mstamp | iso-date"
- rv-title="model:d/mstamp | format-date 'HH:mm:ss'">
- { model:d/mstamp | from-now }
+ rv-datetime="message:d/mstamp | iso-date"
+ rv-title="message:d/mstamp | format-date 'HH:mm:ss'">
+ { message:d/mstamp | from-now }
</time>
</span>
- <div rv-unless="model:html">{ model:text }</div>
- <div class="xhtml-body" rv-if="model:html" rv-html="model:html"></div>
+ <div rv-unless="message:html">{ message:text }</div>
+ <div class="xhtml-body" rv-if="message:html" rv-html="message:html"></div>
</div>
</div>
</div>
--- a/js/messages.js Fri Dec 09 13:23:03 2016 +0800
+++ b/js/messages.js Mon Dec 12 18:00:04 2016 +0800
@@ -125,7 +125,7 @@
MessageView.prototype.render = function(model) {
var contact;
this.rivet = rivets.bind(this.el, {
- model: this.model,
+ message: this.model,
view: this
});
contact = this.model.get('contact');
--- a/js/messages.js.map Fri Dec 09 13:23:03 2016 +0800
+++ b/js/messages.js.map Mon Dec 12 18:00:04 2016 +0800
@@ -6,5 +6,5 @@
"coffee/messages.coffee"
],
"names": [],
- "mappings": ";AAAA;AAAA,MAAA;;;EAAM,IAAI,CAAC;;;;;;;sBACT,QAAA,GAAU,SAAA;aACR;QAAA,KAAA,EAAW,IAAA,IAAA,CAAA,CAAX;;IADQ;;sBAGV,UAAA,GAAY,SAAA;aACV,IAAC,CAAA,EAAD,CAAI,kBAAJ,EAAwB,SAAA;eACtB,IAAC,CAAA,GAAD,CAAK,UAAL,EAAiB,MAAA,CAAO,IAAC,CAAA,GAAD,CAAK,OAAL,CAAP,CAAjB;MADsB,CAAxB;IADU;;;;KAJa,QAAQ,CAAC;;EAS9B,IAAI,CAAC;;;;;;;uBACT,KAAA,GAAO,IAAI,CAAC;;uBACZ,cAAA,GAAgB,EAAA,GAAK,EAAL,GAAU;;uBAC1B,aAAA,GAAe,EAAA,GAAK;;uBAEpB,UAAA,GAAY,SAAC,KAAD;aACV,KAAK,CAAC,GAAN,CA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