forked from jakiestfu/Context.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo2.js
103 lines (101 loc) · 3.27 KB
/
demo2.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
exampleMenuItemSource = function (selector) {
if ($(selector).attr('id') == 'PNG_JPG') {
return [
{
header: 'Example Dynamic'
},
{
text: 'PNG',
action: function(e, selector) { alert('PNG clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
text: 'JPG',
action: function(e, selector) { alert('JPG clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{ divider: true },
{
icon: 'glyphicon-list-alt',
text: 'Dynamic nested',
subMenu : [
{
text: 'More dynamic',
action: function(e, selector) { alert('More dynamic clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
text: 'And more...',
action: function(e, selector) { alert('And more... clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
}
]
}
]
} else {
return [
{
icon: 'glyphicon-exclamation-sign',
text: 'No image types supported!'
}
]
}
}
test_menu = {
id: 'TEST-MENU',
data: [
{
header: 'Example'
},
{
icon: 'glyphicon-plus',
text: 'Create',
action: function(e, selector) { alert('Create clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
icon: 'glyphicon-edit',
text: 'Edit',
action: function(e, selector) { alert('Edit clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
icon: 'glyphicon-list-alt',
text: 'View Data As:',
subMenu : [
{
text: 'Text',
action: function(e, selector) { alert('Text clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
text: 'Image',
subMenu: [
{
menu_item_src : exampleMenuItemSource
}
]
}
]
},
{
divider: true
},
{
header: 'Another Example'
},
{
icon: 'glyphicon-trash',
text: 'Delete',
action: function(e, selector) { alert('Delete clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
}
]
};
test_menu2 = [
{
header: 'Example'
},
{
icon: 'glyphicon-plus',
text: 'Create',
action: function(e, selector) { alert('Create clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
},
{
icon: 'glyphicon-edit',
text: 'Edit',
action: function(e, selector) { alert('Edit clicked on ' + selector.prop("tagName") + ":" + selector.attr("id")); }
}
];