Skip to content

Commit eb68232

Browse files
Added dialog functional demo
1 parent d7cde8a commit eb68232

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

demos/functional/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<script src="js/chili-recipes.js" type="text/javascript"></script>
5454
</head>
5555

56-
<body id="functional_demos">
56+
<body class="flora" id="functional_demos">
5757
<!--[if IE 5]><div id="ie5" class="ie"><![endif]-->
5858
<!--[if IE 6]><div id="ie6" class="ie"><![endif]-->
5959
<!--[if IE 7]><div id="ie7" class="ie"><![endif]-->

demos/functional/js/functional.demo.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ var uiRenderDemo = function(model) {
162162

163163
var loadDemo = function(comp) {
164164

165+
$("#dialog").dialog().remove();
166+
165167
$('#containerDemo').html("<img src='images/ajax-loader.gif'>");
166168

167169
$("#containerDemo").ajaxError(function(request, settings){
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script type="text/javascript">
2+
3+
var model = {
4+
5+
renderAt: '#containerDemo',
6+
7+
title: 'Dialog Demos',
8+
9+
demos: [
10+
11+
{
12+
title: 'Simple dialog',
13+
desc: 'With few lines of code you could build a dialog. You can try more options on the fly!',
14+
html: '<div id="dialog">jQuery UI Dialog</div>',
15+
destroy: '$("#dialog").dialog("destroy");',
16+
options: [
17+
{ desc: 'Make a simple dialog', source: '$("#dialog").dialog();' },
18+
{ desc: 'Modal dialog', source: '$("#dialog").dialog({ modal: true });' },
19+
{ desc: 'Modal dialog with overlay', source: '$("#dialog").dialog({ modal: true, overlay: { opacity: 0.5, background: "black" } });' },
20+
{ desc: 'With buttons', source: '$("#dialog").dialog({buttons: { "Ok": function() { alert("Ok"); }, "Cancel": function() { $(this).dialog("close"); } }});' },
21+
{ desc: 'Close the dialog', source: '$("#dialog").dialog("close");' }
22+
]
23+
}
24+
25+
]
26+
};
27+
28+
$(function(){
29+
30+
uiRenderDemo(model);
31+
32+
});
33+
34+
</script>

0 commit comments

Comments
 (0)