21 New Patches.
[webos-internals:djcin7s-modifications.git] / app-launcher / app-launcher-hide-quick-launch-bar-in-launcher-remix.patch
1 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
2 index b9db2c2..340811a 100644
3 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
4 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
5 @@ -249,9 +249,6 @@ GlobalSearchAssistant = Class.create({
6                         SystemManagerService.showLauncher(false);
7                         this.launcherHiddenAtFirstKeydown = false;
8                 }
9 -               else {
10 -                       SystemManagerService.showQuickLaunch(true);
11 -               }
12                 
13                 this.galInit();
14         },
15 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
16 index 9057138..13e79b7 100644
17 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
18 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
19 @@ -8,7 +8,7 @@ var LauncherAssistant = Class.create({
20          * hardcoding the quick launch height until we can find a better way. 
21          * This value = ql graphic height - the offset from the top (small fade area)
22          */
23 -       kQuickLaunchHeight: 67,
24 +       kQuickLaunchHeight: 0,
25         
26         kPageIndicatorSpacing: 6,       /* spacing between each page indicator */
27         kPageMargin: 10, /* 10 pixel margin on each side of a page */
28 @@ -23,10 +23,15 @@ var LauncherAssistant = Class.create({
29                 visible: true,
30                 label: $L('Launcher'),
31          items: [
32 -                       /*{ label: $L('New page'), command: 'newpage' },
33 -                       { label: $L('Delete page'), command: 'deletepage' },*/
34                         Mojo.Menu.editItem,
35 -                       { label: $L('List Apps...'), command: 'listapps' },
36 +                       { label: $L('Edit Pages'),
37 +                               items: [
38 +                                       { label: $L('New page'), command: 'newpage' },
39 +                                       { label: $L('Delete page'), command: 'deletepage' }
40 +                               ]
41 +                       },
42 +                       { label: $L('Edit Quick Launch'), command: 'quicklaunch' },
43 +                       { label: $L('List All Applications'), command: 'listapps' },
44                         { label: $L('Default Applications'), command: 'defaultapps'},
45                         Mojo.Menu.helpItem
46                 ]
47 @@ -63,6 +68,7 @@ var LauncherAssistant = Class.create({
48         
49         setup: function() {
50                 
51 +               Mojo.listen(this.controller.document, Mojo.Event.activate, this.onActivate.bindAsEventListener(this));
52                 Mojo.listen(this.controller.document, Mojo.Event.deactivate, this.onDeactivate.bindAsEventListener(this));
53                 Mojo.listen(this.controller.window, 'resize', this.onResize.bindAsEventListener(this));
54                 
55 @@ -121,7 +127,11 @@ var LauncherAssistant = Class.create({
56                                 case 'defaultapps':
57                                         ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.defaultAppParams);
58                                         break;
59 -                               /*
60 +                               case 'quicklaunch':
61 +                                       SystemManagerService.showQuickLaunch(true);
62 +                                       this.kQuickLaunchHeight = 67;
63 +                                       this.adjustLayout();
64 +                                       break;
65                                 case 'newpage':
66                                         if (this.pageDivs.length < 10) {
67                                                 this.insertPage(this.activePageIndex, true);
68 @@ -135,7 +145,6 @@ var LauncherAssistant = Class.create({
69                                                 }
70                                         }
71                                         break;
72 -                               */
73                         }
74                 }
75                 else if (event.type === Mojo.Event.commandEnable) {
76 @@ -164,6 +173,14 @@ var LauncherAssistant = Class.create({
77                 this.updatePageIndicators();
78         },
79         
80 +       /* hide quick launch */
81 +       onActivate: function(event) {
82 +               this.kQuickLaunchHeight = 0;
83 +               this.adjustLayout();
84 +
85 +               SystemManagerService.showQuickLaunch(false);
86 +       },
87 +       
88         /* clean and hide global search */
89         onDeactivate: function(event) {
90                 
91 @@ -578,14 +595,12 @@ var LauncherAssistant = Class.create({
92                         }
93                 }
94                 
95 -               SystemManagerService.showQuickLaunch(false);
96                 this.globalSearchAssistant.enable(false);
97                 
98                 var appInfoAssistant = new AppInfoAssistant(appInfo,
99                                                                                                         this.controller,
100                                                                                                         function() {
101                                                                                                                 this.appDialog = undefined;
102 -                                                                                                               SystemManagerService.showQuickLaunch(true);
103                                                                                                                 this.globalSearchAssistant.enable(true);
104                                                                                                         }.bind(this));
105