fix highlighting of text in search, make title bigger
This commit is contained in:
parent
52f4ff9a2f
commit
a97fa571a1
|
@ -0,0 +1,13 @@
|
|||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
|
||||
_highlightOnInsert: function() {
|
||||
const term = this.get('highlight');
|
||||
const self = this;
|
||||
|
||||
if(!_.isEmpty(term)) {
|
||||
self.$().highlight(term.split(/\s+/), {className: 'search-highlight'});
|
||||
}
|
||||
}.observes('highlight').on('didInsertElement')
|
||||
|
||||
});
|
|
@ -26,7 +26,9 @@
|
|||
{{/if}}
|
||||
</span>
|
||||
{{#if result.blurb}}
|
||||
{{{unbound result.blurb}}}
|
||||
{{#highlight-text highlight=controller.q}}
|
||||
{{{unbound result.blurb}}}
|
||||
{{/highlight-text}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,16 +2,4 @@ import ScrollTop from 'discourse/mixins/scroll-top';
|
|||
|
||||
export default Ember.View.extend(ScrollTop, {
|
||||
|
||||
_highlightOnInsert: function() {
|
||||
const term = this.get('controller.q');
|
||||
const self = this;
|
||||
|
||||
if(!_.isEmpty(term)) {
|
||||
Em.run.next(function(){
|
||||
self.$('.blurb').highlight(term.split(/\s+/), {className: 'search-highlight'});
|
||||
// we can highlight title, but I feel its a bit too much
|
||||
// self.$('.topic-title').highlight(term.split(/\s+/), {className: 'search-highlight'} );
|
||||
});
|
||||
}
|
||||
}.observes('controller.model').on('didInsertElement')
|
||||
});
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
}
|
||||
.avatar {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
top: -3px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.search-link {
|
||||
.topic-statuses, .topic-title {
|
||||
font-size: 1.25em;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
}
|
||||
.blurb {
|
||||
|
|
Loading…
Reference in New Issue