jshackles / Enhanced_Steam

Enhances the Steam Experience
www.EnhancedSteam.com
GNU General Public License v3.0
1.31k stars 195 forks source link

[SUGGESTION] fix selection of pages in store search #1513

Closed Dead4W closed 6 years ago

Dead4W commented 6 years ago

1) Fixed a page offset on a search store page when was used data GET "page" Example: 1 How to fix: Replace search_page = 2; to search_page = +$("#search_current_page").val() + 1; on lines 3451 and 3524 (enhancedsteam.js) 2) Changed URL to URL last loaded page ( After page reload (F5) offset will begin from last loaded page ) How to add: Add additional function: (enhancedsteam.js) function setLoc(loc,historySave) { curLoc = loc.replace(/#(\/|!)?/, ''); var l = (location.toString().match(/#(.*)/) || {})[1] || ''; if (!l) { l = (location.pathname || '') + (location.search || ''); } l = encodeURIComponent(l); if (l.replace(/^(\/|!)/, '') != curLoc) { try { if( historySave !== undefined ) { history.pushState({}, '', '/' + curLoc); } else { history.replaceState({}, '', '/' + curLoc); } return; } catch(e) {} window.chHashFlag = true; location.hash = '#/' + curLoc; if (withFrame && getLoc() != curLoc) { setFrameContent(curLoc); } } Remove string search_page = search_page + 1; After string runInPageContext(ripc); in load_search_results() insert setLoc('search/' + search + '&page=' + search_page++); Example function load_search_results() runInPageContext(ripc); setLoc('search/' + search + '&page=' + search_page++); }).error(function() { Optional: Add page select input 2

I apologize for any mistakes in English :P