11 New, 3 modified patches for 1.3.1
[webos-internals:shivaramv-modifications.git] / app-launcher / app-launcher-reset-scroll-position.patch
1 --- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js.orig    Sat Dec  5 11:48:12 2009
2 +++ /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js Thu Dec  3 19:42:03 2009
3 @@ -98,5 +98,9 @@
4                 // setup the initial dimensions for launcher/global-search
5                 this.adjustLayout();
6 +               
7 +               // add a separate listener for resetting the scroll position on page changes, and also on deactivate
8 +               Mojo.listen($('launcher_root'), Mojo.Event.propertyChange, this.resetScrollPosition.bindAsEventListener(this));
9 +               Mojo.listen(this.controller.document, Mojo.Event.deactivate, this.resetScrollPosition.bindAsEventListener(this));
10         },
11         
12         ready: function() {     
13 @@ -188,6 +188,12 @@
14         onResize: function(event) {
15                 this.adjustLayout();
16         },
17  
18 +       resetScrollPosition: function(event) {
19 +               var pageIndex = (event.type === 'mojo-event-deactivate') ? this.activePageIndex : event.value;
20 +               var scroller = this.getPageScroller(pageIndex);
21 +               if (scroller && scroller.mojo) { scroller.mojo.revealTop(); }
22 +       },
23 +
24         /* remove page data and their corresponding HTML */
25         deleteAllPages: function() {
26