13 ported and 1 new for 1.4.0.
[webos-internals:imagineer1981s-modifications.git] / app-launcher / app-launcher-reset-to-first-page.patch
1 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
2 index 9057138..019fb80 100644
3 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
4 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
5 @@ -178,6 +178,19 @@ var LauncherAssistant = Class.create({
6                 SystemManagerService.showQuickLaunch(true);
7                 
8                 this.launchRequest = undefined;
9 +
10 +               /* Reset launcher to first page - seems we need to do scrollTo AND setSnapIndex to be fully compatible with Wrap Pages */
11 +               $('launcher_root').mojo.scrollTo(0, undefined, false, true);
12 +               this.activePageIndex = Math.abs($('launcher_root').mojo.getScrollPosition().left) / this.kPageWidth;
13 +               $('launcher_root').mojo.setSnapIndex(0, false);
14 +               this.updatePageIndicators();
15 +
16 +               /* Jump scroll position back to top for all pages */
17 +               var numPages=this.pagesModel.getNumPages();
18 +               for (var i=0; i<numPages; i++) {
19 +                       var scroller = this.getPageScroller(i);
20 +                       if (scroller && scroller.mojo) { scroller.mojo.revealTop(); }
21 +               }
22         },
23         
24         onResize: function(event) {