blob: d7bd28be2b5a679bc18e1757173e34489f4cb548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/* ************************************************************************
#module(Tr)
************************************************************************ */
/**
* A label with the ability to link out. Based on Label.
*/
qx.Class.define('tr.ui.Link', {
extend : qx.ui.basic.Label,
/*
*****************************************************************************
CONSTRUCTOR
*****************************************************************************
*/
/**
* @param text {String} Initial label
* @param url {String} Where to link to
* @param color {String} Hex Color for the text
* @param font {String} Font from string representation
*/
construct : function(text, url, color, font) {
this.base(arguments, text);
if (color) {
this.setTextColor(color);
}
if (font) {
this.setFont(qx.bom.Font.fromString(font));
}
this.set({
cursor : 'pointer',
opacity : 0.9
});
this.addListener('click', function(e) {
window.open(url, '__new');
});
this.addListener('mouseover', function(e) {
this.setOpacity(1);
}, this);
this.addListener('mouseout', function(e) {
this.setOpacity(0.7);
}, this);
}
});
|