Generalize toast view template

// FREEBIE
This commit is contained in:
lilia 2016-09-06 17:11:44 -07:00
parent d7b6e7c26b
commit 141cdef2a4
3 changed files with 4 additions and 6 deletions

View File

@ -48,8 +48,8 @@
</a>
{{ expiredWarning }}
</script>
<script type='text/x-tmpl-mustache' id='expired_toast'>
{{ expiredWarning }}
<script type='text/x-tmpl-mustache' id='toast'>
{{ toastMessage }}
</script>
<script type='text/x-tmpl-mustache' id='hint'>
<p> {{ content }}</p>

View File

@ -6,11 +6,8 @@
window.Whisper = window.Whisper || {};
Whisper.ExpiredToast = Whisper.ToastView.extend({
templateName: 'expired_toast',
render_attributes: function() {
return {
expiredWarning: i18n('expiredWarning')
};
return { toastMessage: i18n('expiredWarning') };
}
});

View File

@ -7,6 +7,7 @@
Whisper.ToastView = Whisper.View.extend({
className: 'toast',
templateName: 'toast',
initialize: function() {
this.$el.hide();
},