Commit acfd8ed9c27d017bd5d17bef9d0c6624296e0ba4
1 parent
2585c602
Exists in
master
9059: correction pour compatibilité avec d'autres navigateurs de l'affichage des frames dans l'about
Suppression de l'autoload des frames, chargement asynchrone plus stable de la liste des frames
Showing
2 changed files
with
37 additions
and
15 deletions
Show diff stats
ihm/app/controller/Application/Help/Help.js
1 | 1 | Ext.define('treps.controller.Application.Help.Help', { |
2 | 2 | extend: 'Ext.app.Controller', |
3 | 3 | |
4 | + requires: [ | |
5 | + 'treps.controller.Frames.FramesManager' | |
6 | + ], | |
7 | + | |
4 | 8 | views: [ |
5 | 9 | 'Application.Help.HelpPanel', |
6 | 10 | 'Application.Footer.FooterToolbar' |
7 | 11 | ], |
8 | 12 | |
9 | 13 | stores: [ |
10 | - 'Helps', | |
11 | - 'Frames' | |
14 | + 'Frames', | |
15 | + 'Helps' | |
12 | 16 | ], |
13 | 17 | |
14 | 18 | refs: [ |
... | ... | @@ -51,16 +55,15 @@ Ext.define('treps.controller.Application.Help.Help', { |
51 | 55 | } |
52 | 56 | } |
53 | 57 | ); |
54 | - | |
55 | - | |
56 | - | |
57 | 58 | |
58 | 59 | }, |
59 | 60 | |
61 | + | |
60 | 62 | onAbout: function() |
61 | 63 | { |
62 | 64 | this.setHelp('about'); |
63 | 65 | }, |
66 | + | |
64 | 67 | |
65 | 68 | renderPage: function(pageId) |
66 | 69 | { |
... | ... | @@ -75,10 +78,9 @@ Ext.define('treps.controller.Application.Help.Help', { |
75 | 78 | treps.Messages.showError("Cannot retrieve help page id"); |
76 | 79 | return; |
77 | 80 | } |
78 | - | |
79 | - | |
81 | + | |
82 | + | |
80 | 83 | var lFrames = this.getFramesStore(); |
81 | - //lFrames.load(); | |
82 | 84 | |
83 | 85 | var file = page.get('file'); |
84 | 86 | var renderer = this.getRendererPanel(); |
... | ... | @@ -109,9 +111,11 @@ Ext.define('treps.controller.Application.Help.Help', { |
109 | 111 | |
110 | 112 | |
111 | 113 | //generate about help |
112 | - //text+="<br/>page selected : "+pageId; | |
114 | + | |
113 | 115 | if(pageId=='about') { |
116 | + console.log("renderFrames: "+lFrames.count(false)); | |
114 | 117 | text+="<ul>"; |
118 | + //lFrames.load(); | |
115 | 119 | lFrames.each(function(record){ |
116 | 120 | if(record.get("description") === "") { |
117 | 121 | text+="<li>"+record.get("id")+" - "+record.get("fullname")+"</li>"; |
... | ... | @@ -121,10 +125,7 @@ Ext.define('treps.controller.Application.Help.Help', { |
121 | 125 | } |
122 | 126 | }); |
123 | 127 | text+="</ul>"; |
124 | - | |
125 | 128 | } |
126 | - | |
127 | - | |
128 | 129 | |
129 | 130 | loader.getTarget().update(text); |
130 | 131 | return true; |
... | ... | @@ -134,7 +135,25 @@ Ext.define('treps.controller.Application.Help.Help', { |
134 | 135 | |
135 | 136 | onSelectPage: function(combo, newValue, oldValue, eOpts) |
136 | 137 | { |
137 | - this.renderPage(newValue); | |
138 | + var me = this; | |
139 | + if(newValue!='about') { | |
140 | + this.renderPage(newValue); | |
141 | + }else{ | |
142 | + var lFrames = this.getFramesStore(); | |
143 | + lFrames.load(); | |
144 | + if(lFrames.getCount(false)==0){ | |
145 | + treps.controller.Frames.FramesManager.loadFramesStore( | |
146 | + function(lFrames){ | |
147 | + console.log("store loaded! "+lFrames.count(false)+" "+newValue); | |
148 | + me.renderPage(newValue); | |
149 | + } | |
150 | + ); | |
151 | + } else { | |
152 | + //frames already loaded | |
153 | + me.renderPage(newValue); | |
154 | + } | |
155 | + | |
156 | + } | |
138 | 157 | }, |
139 | 158 | |
140 | 159 | setHelp: function(pageId, forceCollapse) { |
... | ... | @@ -142,6 +161,8 @@ Ext.define('treps.controller.Application.Help.Help', { |
142 | 161 | if (forceCollapse != null) |
143 | 162 | forceColl = forceCollapse; |
144 | 163 | |
164 | + | |
165 | + | |
145 | 166 | var panel = this.getHelpPanel(); |
146 | 167 | |
147 | 168 | if ((panel.getCollapsed() !== false) && forceColl) |
... | ... | @@ -158,7 +179,9 @@ Ext.define('treps.controller.Application.Help.Help', { |
158 | 179 | var versionDiv = Ext.fly('about-version'); |
159 | 180 | if (versionDiv) |
160 | 181 | Ext.fly('about-version').update("Kernel Version: "+kernelVersion); |
182 | + }, | |
183 | + setFrameStore: function(frameStore) { | |
184 | + var lFrame = frameStore; | |
161 | 185 | } |
162 | - | |
163 | 186 | |
164 | 187 | }); | ... | ... |