Skip to content

Commit

Permalink
Improve tip cooking and fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Aug 8, 2019
1 parent 6604589 commit e4be013
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { cookAsync } from "discourse/lib/text";

export default Ember.Component.extend({
classNames: 'topic-tip',

didInsertElement() {
Ember.$(document).on('click', Ember.run.bind(this, this.documentClick));

console.log(this.get('details'), this.get('detailsOpts'));

let rawDetails = I18n.t(this.get('details'), this.get('detailsOpts'));

console.log(rawDetails);

cookAsync(rawDetails).then(cooked => {
console.log(cooked)
this.set('cookedDetails', cooked);
});
},

willDestroyElement() {
Expand All @@ -23,4 +36,4 @@ export default Ember.Component.extend({
this.toggleProperty('showDetails');
}
}
})
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{#if showTip}}
{{topic-tip label=label details=details detailsOpts=detailsOpts}}
{{qa-topic-tip label=label details=details detailsOpts=detailsOpts}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{d-button class="btn btn-topic-tip" action="toggleDetails" label=label icon='info'}}
{{#if showDetails}}
<div class="tip-details">
{{{i18n details detailsOpts}}}
{{cookedDetails}}
</div>
{{/if}}

0 comments on commit e4be013

Please sign in to comment.