| author | hamidouk |
| Fri, 27 Jan 2012 11:29:03 +0100 | |
| branch | popcorn-port |
| changeset 729 | 7ba63d0315ad |
| parent 685 | 973d9a495d11 |
| child 827 | 1dc2f85c3b89 |
| 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); |
| 550 | 14 |
// position the widget absolutely relative to document. |
15 |
this.selector.css("position", "static"); |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
16 |
this.selector.append(templ); |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
17 |
this.hide(); |
|
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 |
}; |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
20 |
|
|
336
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
21 |
IriSP.TooltipWidget.prototype.clear = function() { |
| 685 | 22 |
this.selector.find(".tiptext").html(""); |
|
336
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
23 |
}; |
|
8da13562cfea
segmentsWidget now uses the TooltipWidget instead of the jQuerytools tooltip.
hamidouk
parents:
289
diff
changeset
|
24 |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
25 |
IriSP.TooltipWidget.prototype.show = function(text, color, x, y) { |
| 478 | 26 |
|
| 579 | 27 |
if (this._displayedText == text && this._shown) |
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
28 |
return; |
| 579 | 29 |
|
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
30 |
this.selector.find(".tipcolor").css("background-color", color); |
| 477 | 31 |
this._displayedText = text; |
| 685 | 32 |
this.selector.find(".tiptext").html(text); |
| 646 | 33 |
|
34 |
if (x < 0) |
|
35 |
x = 0; |
|
36 |
if (y < 0) |
|
37 |
y = 0; |
|
38 |
|
|
| 489 | 39 |
this.selector.find(".tip").css("left", x).css("top", y); |
| 477 | 40 |
this.selector.find(".tip").show(); |
| 474 | 41 |
this._shown = true; |
|
289
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
42 |
}; |
|
c0e399fbf3fb
due to a np++ crash, some files where created in with windows line endings.
hamidouk
parents:
231
diff
changeset
|
43 |
|
| 478 | 44 |
IriSP.TooltipWidget.prototype.hide = function() { |
45 |
this.selector.find(".tip").hide(); |
|
46 |
this._shown = false; |
|
| 487 | 47 |
}; |