Commit 1e1e21b1508f08142da537cd059a6954bd1ac0c5

Authored by Conrad Vermeulen
1 parent e019e670

KTS-2891

"Search widget is too big as it is invisible when the screen resolution is low"
Fixed. Add Dashlet widget was not catered for on dashboard.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8116 c91229c3-7414-0410-bfa2-8a42b809f60b
resources/js/dashboard.js
... ... @@ -43,7 +43,7 @@ KTDashlet.prototype = {
43 43 'getStatus' : function() {
44 44 return this.dashboard.getStatus(this.id);
45 45 }
46   -
  46 +
47 47 };
48 48  
49 49  
... ... @@ -74,7 +74,7 @@ KTDashboard.prototype = {
74 74 }, this.getDashletBlocks());
75 75  
76 76 // make add button
77   - var breadcrumbs = $('breadcrumbs');
  77 + var breadcrumbs = $('add-dashlet');
78 78 this.addButton = INPUT({'id':'add_dashlet', 'type':'submit', 'value':_('Add Dashlet')});
79 79 breadcrumbs.insertBefore(this.addButton, breadcrumbs.firstChild);
80 80 this.hideAddButton();
... ... @@ -86,7 +86,7 @@ KTDashboard.prototype = {
86 86 'mochikitInitializeDraggables' : function() {
87 87 var dashOpts = {
88 88 'tag':'div',
89   - 'constraint': false,
  89 + 'constraint': false,
90 90 'tree':true,
91 91 'only' : ['dashboard_block'],
92 92 'handle' : 'dashboard_block_handle'
... ... @@ -99,13 +99,13 @@ KTDashboard.prototype = {
99 99 if(e.id) {
100 100 new YAHOO.example.DDList(e.id);
101 101 //new YAHOO.util.DD(e.id);
102   - }
  102 + }
103 103 }, this.getDashletBlocks());
104 104 map(function(e) {
105 105 if(e.id) {
106 106 new YAHOO.example.DDList(e.id);
107 107 //new YAHOO.util.DD(e.id);
108   - }
  108 + }
109 109 }, this.getDashletBlockStoppers());
110 110 new YAHOO.example.DDListBoundary('copyrightbar');
111 111 new YAHOO.example.DDListBoundary('breadcrumbs');
... ... @@ -117,7 +117,7 @@ KTDashboard.prototype = {
117 117 'getDashletBlocks' : function() {
118 118 return getElementsByTagAndClassName('*', 'dashboard_block', this.element);
119 119 },
120   -
  120 +
121 121 'getDashletBlockStoppers' : function(){
122 122 return getElementsByTagAndClassName('*', 'dashboard_block_empty', this.element);
123 123 },
... ... @@ -150,7 +150,7 @@ KTDashboard.prototype = {
150 150 }
151 151 }
152 152 },
153   -
  153 +
154 154  
155 155 'setStatus' : function(id, status) {
156 156 this.dashlets[id]['state'] = status;
... ... @@ -161,7 +161,7 @@ KTDashboard.prototype = {
161 161 return this.dashlets[id]['state'];
162 162 },
163 163  
164   - 'getDashletsInState' : function(state) {
  164 + 'getDashletsInState' : function(state) {
165 165 var ret = [];
166 166 for(var i in this.dashlets) {
167 167 if(this.dashlets[i]['state'] == state) {
... ... @@ -169,7 +169,7 @@ KTDashboard.prototype = {
169 169 }
170 170 }
171 171 return ret;
172   - },
  172 + },
173 173  
174 174 'getDashletTitle' : function(elm) {
175 175 var h2 = getElementsByTagAndClassName('H2', null, elm);
... ... @@ -191,7 +191,7 @@ KTDashboard.prototype = {
191 191 var dashletelm = $(id);
192 192 var dashlet = self.dashlets[id]['object'];
193 193  
194   - var link = A({'class':'dashletLink', 'href':'#'}, self.getDashletTitle(dashletelm));
  194 + var link = A({'class':'dashletLink', 'href':'#'}, self.getDashletTitle(dashletelm));
195 195 var linkli = LI(null, link);
196 196  
197 197 connect(link, 'onclick', function(event) {
... ... @@ -199,14 +199,14 @@ KTDashboard.prototype = {
199 199 dashlet.toggleClose(event);
200 200 if(hasElementClass(dashlet.elm, 'rolled-up')) {
201 201 self.setStatus(id, KTDashboard.ROLLEDUP);
202   - }
  202 + }
203 203 event.stop();
204 204 });
205 205 appendChildNodes(dashletList, linkli);
206 206 });
207 207 appendChildNodes(addDialog, H2(null, _('Add Dashlets')));
208 208 appendChildNodes(addDialog, dashletList);
209   -
  209 +
210 210 var closeLink = A({'class':'closeLink','href':'#'}, _('close'));
211 211 connect(closeLink, 'onclick', function(event) { removeElement(addDialogScreen); });
212 212  
... ... @@ -229,7 +229,7 @@ KTDashboard.prototype = {
229 229 ret[col] = [];
230 230 var container = this.getColumn(col);
231 231 forEach(getElementsByTagAndClassName('*', 'dashboard_block', container), function(e) {
232   - if(e.id) {
  232 + if(e.id) {
233 233 try {
234 234 ret[col].push({'id':e.id, 'state':self.dashlets[e.id]['state']});
235 235 } catch(e) {
... ... @@ -247,7 +247,7 @@ KTDashboard.prototype = {
247 247 if(d.id && !hasElementClass(d, 'empty')) {
248 248 appendChildNodes(bucket, d);
249 249 }});
250   -
  250 +
251 251 var hasClosed = false;
252 252  
253 253 for(var col in KTDashboard.columns) {
... ... @@ -264,7 +264,7 @@ KTDashboard.prototype = {
264 264 dobj.object.toggleClose();
265 265 hasClosed = true;
266 266 }
267   -
  267 +
268 268 appendChildNodes(container, elm);
269 269 }
270 270 appendChildNodes(container, $('end-'+col));
... ... @@ -280,12 +280,12 @@ KTDashboard.prototype = {
280 280 },
281 281  
282 282 'pushState' : function(event) {
283   - var args = {'action' : 'json',
284   - 'json_action' : 'saveDashboardState',
  283 + var args = {'action' : 'json',
  284 + 'json_action' : 'saveDashboardState',
285 285 'state' : serializeJSON(this.serialize()) };
286 286 var xmlreq = getXMLHttpRequest();
287 287 xmlreq.open('GET', this.getPushLocation() + '?' + queryString(args), false);
288   - xmlreq.send(null);
  288 + xmlreq.send(null);
289 289 }
290 290  
291 291 };
... ... @@ -308,4 +308,4 @@ addLoadEvent(
308 308 }
309 309 });
310 310  
311   -
  311 +
... ...
templates/kt3/standard_page.smarty
... ... @@ -209,6 +209,7 @@
209 209 <td width="5px">&nbsp;</td>
210 210 <td valign=top align=right width="100">
211 211 <div id="newSearchQuery" /></td>
  212 + <td id="add-dashlet"></td>
212 213 </tr>
213 214 </table>
214 215 </div>
... ...