duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Movies: Detail pane broken? -- Console error for movies.js #1875

Closed moollaza closed 9 years ago

moollaza commented 9 years ago

For some reason we're not showing the thumbnail in the detail pane for single item results (likely the item_detail template...)

There appears to be a console error in these cases...

https://duckduckgo.com/?q=the+lord+of+the+rings+return+of+the+king+movie&t=ffab&ia=movies https://duckduckgo.com/?q=down+periscope+movie&t=ffab&ia=movies

moollaza commented 9 years ago

Looks like this line is the problem: https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/share/spice/movie/movie.js#L117

We didn't consider the single-item view and this needs to be adjusted accordingly.

/cc @jagtalon

iambibhas commented 9 years ago

@moollaza where does the item.$html come from? And where is onItemShown event documented?

moollaza commented 9 years ago

@iambibhas item.$html comes from some internal code, it's simply a reference to $item which is $(item).

onItemShown should be documented in the events section...but it looks like it's not. Will make Made a task.

moollaza commented 9 years ago

@iambibhas looks like this has been fixed in https://github.com/duckduckgo/zeroclickinfo-spice/pull/1884