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