blob: df5b02e85b27d8acf0aed8a83417073a74eaf5a3 (
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
|
// Theme component
enyo.kind({
name: "Abcd.Letter",
kind: "Abcd.Item",
published: { letter: "" },
classes: "itemLetter",
showing: false,
components: [
{ name: "itemImage", kind: "Image", onload: "imageLoaded" }
],
// Constructor
create: function() {
this.inherited(arguments);
this.letterChanged();
},
// Display only when image is load
imageLoaded: function() {
if (this.letter !== "")
this.show();
},
// Localization changed, nothing to do
setLocale: function() {
},
// Card setup
letterChanged: function() {
this.letter = this.letter.toLowerCase()
this.$.itemImage.setAttribute("src", "images/letters/"+this.letter+".png");
}
});
|