| author | hamidouk |
| Mon, 19 Dec 2011 16:04:14 +0100 | |
| branch | popcorn-port |
| changeset 483 | 0bb36c79836c |
| parent 480 | 043a159c75f0 |
| child 487 | 4c006b1dcc66 |
| permissions | -rw-r--r-- |
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
1 |
/* this widget displays a small tooltip */ |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
2 |
IriSP.TooltipWidget = function(Popcorn, config, Serializer) { |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
3 |
IriSP.Widget.call(this, Popcorn, config, Serializer); |
| 474 | 4 |
this._shown = false; |
| 477 | 5 |
this._displayedText = ""; |
6 |
this._hideTimeout = -1; |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
7 |
}; |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
8 |
|
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
9 |
|
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
10 |
IriSP.TooltipWidget.prototype = new IriSP.Widget(); |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
11 |
|
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
12 |
IriSP.TooltipWidget.prototype.draw = function() { |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
13 |
var templ = Mustache.to_html(IriSP.tooltipWidget_template); |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
14 |
|
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
15 |
this.selector.append(templ); |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
16 |
this.hide(); |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
17 |
|
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
18 |
}; |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
19 |
|
|
336
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
20 |
IriSP.TooltipWidget.prototype.clear = function() { |
|
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
21 |
this.selector.find(".tiptext").text(""); |
|
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
22 |
}; |
|
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
23 |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
24 |
IriSP.TooltipWidget.prototype.show = function(text, color, x, y) { |
| 478 | 25 |
|
26 |
if (this._displayedText == text) |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
27 |
return; |
| 477 | 28 |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
29 |
this.selector.find(".tipcolor").css("background-color", color); |
| 477 | 30 |
this._displayedText = text; |
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
31 |
this.selector.find(".tiptext").text(text); |
| 477 | 32 |
//this.selector.find(".tip").css("left", x).css("top", y); |
| 478 | 33 |
this.selector.find(".tip").css("left", x).css("top", "-180px"); |
| 477 | 34 |
this.selector.find(".tip").show(); |
| 474 | 35 |
this._shown = true; |
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
36 |
}; |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
37 |
|
| 478 | 38 |
IriSP.TooltipWidget.prototype.hide = function() { |
39 |
this.selector.find(".tip").hide(); |
|
40 |
this._shown = false; |
|
|
336
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
41 |
}; |