Sheep-y / trpg-dnd-4e-db

4e Compendium - Offline D&D 4e Database
Other
58 stars 7 forks source link

Cannot select search result when 'All Catagory' is selected. #11

Closed galford13x closed 8 years ago

galford13x commented 10 years ago

Problem: Cannot select an item in the list unless a catagory button is selected. Desire: Generally the search result provides the desired item within the first few rows of the result list (Good job on the search routine). Fix: The problem is in the - funciton act_list_row_click() - the 'cat' object is not set correctly when 'All Catagory' was last searched. Change line 3773:

if ( ! cat ) cat = this.getAttribute( 'data-category' );    //original

to

if ( ! cat ) cat = od.data.get( this.getAttribute( 'data-category' ));      // FIXED
Sheep-y commented 10 years ago

Thanks for reporting. Few would go to such length as suggesting a fix (that works correctly!).

This issue has been fixed in development branch. A new version will be released after fixing remaining issues with data update.

galford13x commented 10 years ago

It appears my previous post was not accepted. I suppose I'll repost.

I have downloaded and compiled the dev branch version, however, it appears there is a type mismatch when loading the 'data-category' into the results table when the All Category button is selected. Specifically line 581 of action_list.html or line 5596 of 4e_database.html. I would recommend changing

if ( action.category === null ) row.setAttribute( 'data-category', cat_name );

to

if ( action.category === "" ) row.setAttribute( 'data-category', cat_name );

It appears action.category will never === null but instead can be an empty string.

btw, I really like the new changes, sorting/filtering of columns is great. Although I'm not sure how much I like the syntax highlighting. Is it possible to make that an option?

Sheep-y commented 9 years ago

Accidentally closed because of wrong commit message. Reopening.