-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (26 loc) · 920 Bytes
/
app.js
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
// Main app class
enyo.kind({
name: "Farming.App",
kind: enyo.Control,
classes: "main",
components: [
{components: [
{name: "crops", kind: "Image", src: "icons/crops.png", classes: "cropsbutton", ontap: "showCrops"},
{name: "livestock", kind: "Image", src: "icons/livestock.png", classes: "livestockbutton", ontap: "showLivestock"},
{content: "Crops", classes: "crops_text"},
{content: "Livestock", classes: "livestock_text"},
]},
],
// Constructor
create: function() {
this.inherited(arguments);
},
// Show all crops
showCrops: function(e, s) {
Farming.context.home = new Farming.Crops().renderInto(document.getElementById("body"));
},
// Show all livestock
showLivestock: function(e, s) {
Farming.context.home = new Farming.Livestock().renderInto(document.getElementById("body"));
}
});