aboutsummaryrefslogtreecommitdiffstats
path: root/demos/real-world
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2008-09-03 14:29:16 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2008-09-03 14:29:16 +0000
commit7084fa079da7315ee9e3eabfa1abd6009837bb76 (patch)
treedbbe6291fe3510b2ad371d4afd30de5ebef92a0a /demos/real-world
parent6174fef86fa61c86381283361364d2242b94e739 (diff)
downloadjquery-ui-7084fa079da7315ee9e3eabfa1abd6009837bb76.tar.gz
jquery-ui-7084fa079da7315ee9e3eabfa1abd6009837bb76.zip
layout demo: add new components via cloned draggables, connected to sortables
Diffstat (limited to 'demos/real-world')
-rw-r--r--demos/real-world/layout/demo.css2
-rw-r--r--demos/real-world/layout/demo.js6
-rw-r--r--demos/real-world/layout/img01.pngbin0 -> 58229 bytes
-rw-r--r--demos/real-world/layout/index.html21
4 files changed, 24 insertions, 5 deletions
diff --git a/demos/real-world/layout/demo.css b/demos/real-world/layout/demo.css
index 151c770f3..9271b0c49 100644
--- a/demos/real-world/layout/demo.css
+++ b/demos/real-world/layout/demo.css
@@ -41,6 +41,6 @@ dl.sort dt span.options a.disabled { background:#555 !important; cursor:default;
#content { float:left; width:400px; }
#sidebar { float:left; width:200px; }
#footer { width:638px; }
-#trashcan { float:left; }
+#meta { float:left; }
#trashcan p { margin:0; } \ No newline at end of file
diff --git a/demos/real-world/layout/demo.js b/demos/real-world/layout/demo.js
index d93c76d4c..039f1463d 100644
--- a/demos/real-world/layout/demo.js
+++ b/demos/real-world/layout/demo.js
@@ -81,11 +81,15 @@
//placeholder: 'placeholder',
connectWith: els,
start: function(e,ui) {
- ui.helper.css("width", ui.item.width());
+ ui.helper.css("width", ui.item.parent().width());
},
change: sortableChange,
update: sortableUpdate
});
+ $('#components > dl').draggable({
+ connectToSortable: $els,
+ helper: 'clone'
+ })
});
$(window).bind('load',function(){
diff --git a/demos/real-world/layout/img01.png b/demos/real-world/layout/img01.png
new file mode 100644
index 000000000..42900c7c6
--- /dev/null
+++ b/demos/real-world/layout/img01.png
Binary files differ
diff --git a/demos/real-world/layout/index.html b/demos/real-world/layout/index.html
index 7e8edb8fa..deacea119 100644
--- a/demos/real-world/layout/index.html
+++ b/demos/real-world/layout/index.html
@@ -68,9 +68,24 @@
</div>
</div>
- <div id="trashcan" class="ui-sortable">
- <h2>Trash can</h2>
- <p>Drag modules here to delete them.</p>
+ <div id="meta">
+ <div id="components" class="ui-sortable">
+ <h2>Components</h2>
+ <dl class="sort">
+ <dt>Subheadline</dt>
+ <dd>Paragraph</dd>
+ </dl>
+ <dl class="sort">
+ <dt>Image</dt>
+ <dd><img src="img01.png" /></dd>
+ <dd>Caption</dd>
+ </dl>
+ </div>
+
+ <div id="trashcan" class="ui-sortable">
+ <h2>Trash can</h2>
+ <p>Drag modules here to delete them.</p>
+ </div>
</div>
<div class="clear"></div>