← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7746: (DV) Improved tooltips.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 7746 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-07-28 13:03:09 +0200
message:
  (DV) Improved tooltips.
modified:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2012-07-27 11:02:30 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2012-07-28 11:01:29 +0000
@@ -349,20 +349,22 @@
     background-image: linear-gradient(top, #f1f1f1,#f5f5f5);
 }
 
-/* Tooltip */
-.x-tip {
+/* Tooltip */.x-tip {
     border-radius: 2px;
-    padding: 3px 4px;
-    border: 1px solid #444;
-    background-color: #444;
+    padding: 1px 4px;
+    border: 1px solid #111;
+    background-color: #111;
 }
 
 .x-tip .x-tip-body {
-	font-size: 11px;
-	font-weight: bold;
+	font-size: 10px;
 	color: #fff;
 }
 
+.x-tip-anchor {
+	border-bottom-color: #444;
+}
+
 /* Chart tips (tooltip) */
 .x-tip .x-tip-header .x-box-item {
     text-align: center;

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2012-07-27 11:02:30 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2012-07-28 11:01:29 +0000
@@ -1991,7 +1991,7 @@
 			render: function() {
 				if (!DV.c.rendered) {
 					DV.cmp.toolbar.datatable.enable();
-					DV.cmp.toolbar.datatable.setTooltip('');
+					DV.cmp.toolbar.datatable.disabledTooltip.destroy();
 					DV.c.rendered = true;
 				}
 			},
@@ -2499,6 +2499,12 @@
                                 afterrender: function(b) {
                                     if (b.xtype === 'button') {
                                         DV.cmp.charttype.push(b);
+                                        
+										Ext.create('Ext.tip.ToolTip', {
+											target: b.getEl(),
+											html: b.tooltiptext,
+											'anchor': 'bottom'
+										});
                                     }
                                 }
                             }
@@ -2513,44 +2519,44 @@
 								xtype: 'button',
                                 icon: 'images/column.png',
                                 name: DV.conf.finals.chart.column,
-                                tooltip: DV.i18n.column_chart,
+                                tooltiptext: DV.i18n.column_chart,
                                 pressed: true
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/column-stacked.png',
                                 name: DV.conf.finals.chart.stackedcolumn,
-                                tooltip: DV.i18n.stacked_column_chart
+                                tooltiptext: DV.i18n.stacked_column_chart
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/bar.png',
                                 name: DV.conf.finals.chart.bar,
-                                tooltip: DV.i18n.bar_chart
+                                tooltiptext: DV.i18n.bar_chart
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/bar-stacked.png',
                                 name: DV.conf.finals.chart.stackedbar,
-                                tooltip: DV.i18n.stacked_bar_chart
+                                tooltiptext: DV.i18n.stacked_bar_chart
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/line.png',
                                 name: DV.conf.finals.chart.line,
-                                tooltip: DV.i18n.line_chart
+                                tooltiptext: DV.i18n.line_chart
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/area.png',
                                 name: DV.conf.finals.chart.area,
-                                tooltip: DV.i18n.area_chart
+                                tooltiptext: DV.i18n.area_chart
                             },
                             {
 								xtype: 'button',
                                 icon: 'images/pie.png',
                                 name: DV.conf.finals.chart.pie,
-                                tooltip: DV.i18n.pie_chart
+                                tooltiptext: DV.i18n.pie_chart
                             }
                         ]
                     },
@@ -4695,17 +4701,27 @@
 							xable: function() {
 								if (DV.c.currentFavorite) {
 									this.enable();
-									this.setTooltip('');
+									this.disabledTooltip.destroy();
 								}
 								else {
-									this.disable();
-									this.setTooltip(DV.i18n.save_load_favorite_before_sharing);
+									if (DV.c.rendered) {
+										this.disable();
+										this.createTooltip();
+									}
 								}
 							},
 							getTitle: function() {
 								return DV.i18n.share + ' ' + DV.i18n.interpretation +
 										': <span style="font-weight:normal; font-size:10px">' + DV.c.currentFavorite.name + '</span>';
 							},
+							disabledTooltip: null,
+							createTooltip: function() {
+								this.disabledTooltip = Ext.create('Ext.tip.ToolTip', {
+									target: this.getEl(),
+									html: DV.i18n.save_load_favorite_before_sharing,
+									'anchor': 'bottom'
+								});
+							},								
 							handler: function() {
 								if (DV.cmp.share.window) {
 									DV.cmp.share.window.setTitle(this.getTitle());
@@ -4787,7 +4803,10 @@
                             listeners: {
                                 added: function() {
                                     DV.cmp.toolbar.share = this;
-                                }
+                                },
+                                afterrender: function() {
+									this.createTooltip();
+								}
                             }
 						},
                         {
@@ -4849,7 +4868,6 @@
 							cls: 'dv-toolbar-btn-2',
                             text: DV.i18n.data_table,
                             disabled: true,
-                            tooltip: DV.i18n.create_chart_before_datatable,
                             handler: function() {
                                 var p = DV.cmp.region.east;
                                 if (p.collapsed && p.items.length) {
@@ -4865,7 +4883,14 @@
                             listeners: {
                                 added: function() {
                                     DV.cmp.toolbar.datatable = this;
-                                }
+                                },
+                                afterrender: function() {
+									this.disabledTooltip = Ext.create('Ext.tip.ToolTip', {
+										target: this.getEl(),
+										html: DV.i18n.create_chart_before_datatable,
+										'anchor': 'bottom'
+									});
+								}
                             }
                         },
                         '->',