Move rating and genres to suggestions only
This commit is contained in:
1 parent
954018fea2
commit
412627aab0
2 files changed
+13
-9
No files matched your search
@@ -215,7 +215,7 @@ Block.Search.Item = new Class({
|
|||||||
'click': self.showOptions.bind(self)
|
'click': self.showOptions.bind(self)
|
||||||
}
|
}
|
||||||
}).adopt(
|
}).adopt(
|
||||||
new Element('div.info').adopt(
|
self.info_container = new Element('div.info').adopt(
|
||||||
self.title = new Element('h2', {
|
self.title = new Element('h2', {
|
||||||
'text': info.titles && info.titles.length > 0 ? info.titles[0] : 'Unknown'
|
'text': info.titles && info.titles.length > 0 ? info.titles[0] : 'Unknown'
|
||||||
}).adopt(
|
}).adopt(
|
||||||
@@ -223,14 +223,6 @@ Block.Search.Item = new Class({
|
|||||||
'text': info.year
|
'text': info.year
|
||||||
}) : null
|
}) : null
|
||||||
)
|
)
|
||||||
).adopt(
|
|
||||||
self.rating = info.rating && info.rating.imdb.length == 2 && parseFloat(info.rating.imdb[0]) > 0 ? new Element('span.rating', {
|
|
||||||
'text': parseFloat(info.rating.imdb[0]),
|
|
||||||
'title': parseInt(info.rating.imdb[1]) + ' votes'
|
|
||||||
}) : null,
|
|
||||||
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
|
||||||
'text': info.genres.slice(0, 3).join(', ')
|
|
||||||
}) : null
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -71,6 +71,18 @@ var SuggestList = new Class({
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
m.data_container.removeEvents('click');
|
m.data_container.removeEvents('click');
|
||||||
|
|
||||||
|
// Add rating
|
||||||
|
m.info_container.adopt(
|
||||||
|
m.rating = m.info.rating && m.info.rating.imdb.length == 2 && parseFloat(m.info.rating.imdb[0]) > 0 ? new Element('span.rating', {
|
||||||
|
'text': parseFloat(m.info.rating.imdb[0]),
|
||||||
|
'title': parseInt(m.info.rating.imdb[1]) + ' votes'
|
||||||
|
}) : null,
|
||||||
|
m.genre = m.info.genres && m.info.genres.length > 0 ? new Element('span.genres', {
|
||||||
|
'text': m.info.genres.slice(0, 3).join(', ')
|
||||||
|
}) : null
|
||||||
|
)
|
||||||
|
|
||||||
$(m).inject(self.el);
|
$(m).inject(self.el);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user