aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2008-09-03 13:02:35 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2008-09-03 13:02:35 +0000
commitd0b0281db1c187aec10231492e276ec5aa9603a2 (patch)
tree87511b1e800238cdd2d7979baf4c6d7b782a5ee5
parentd6a247afffd6169b7ef58f03a67df9dcf5894c30 (diff)
downloadjquery-ui-d0b0281db1c187aec10231492e276ec5aa9603a2.tar.gz
jquery-ui-d0b0281db1c187aec10231492e276ec5aa9603a2.zip
layout demo: minor js refactoring; decreased duration of loading overlay, improved indicator position, fixed overlay in IE (100% height for html and body)
-rw-r--r--demos/real-world/layout/demo-ie.css1
-rw-r--r--demos/real-world/layout/demo.css4
-rw-r--r--demos/real-world/layout/demo.js14
-rw-r--r--demos/real-world/layout/index.html4
4 files changed, 14 insertions, 9 deletions
diff --git a/demos/real-world/layout/demo-ie.css b/demos/real-world/layout/demo-ie.css
new file mode 100644
index 000000000..bb59ee43c
--- /dev/null
+++ b/demos/real-world/layout/demo-ie.css
@@ -0,0 +1 @@
+#overlay #preloader img { margin-top: 11px; } \ No newline at end of file
diff --git a/demos/real-world/layout/demo.css b/demos/real-world/layout/demo.css
index a11738ebf..0076da023 100644
--- a/demos/real-world/layout/demo.css
+++ b/demos/real-world/layout/demo.css
@@ -1,3 +1,5 @@
+html, body { height: 100% }
+
body { background-color:#666; color:#FFF; font:11px/1.5 Arial, sans-serif; margin:0; overflow:hidden; padding:30px 0 0 30px; }
h1 { font-size:18px; margin:0 0 20px; }
a { color:#FFF; }
@@ -6,7 +8,7 @@ a { color:#FFF; }
#overlay { background:#666; height:100%; left:0; position:absolute; top:0; width:100%; z-index:2000; }
#overlay #preloader { background:url(loader_bg.gif) no-repeat; height:50px; left:50%; line-height:50px; margin:-25px 0 0 -25px; position:absolute; text-align:center; top:50%; width:50px; }
-#overlay #preloader img { margin:11px 0 0 0; vertical-align:middle; }
+#overlay #preloader img { margin:0; vertical-align:middle; }
.ui-sortable { background-color:#FFF; border:1px solid #555; color:#222; margin:0 15px 15px 0; padding:0 10px 10px; width:175px; }
.ui-sortable h2 { background-color:#555; border-top:3px solid #666; color:#FFF; font-size:11px; margin:0 -10px 10px; line-height:2; padding:0 10px; }
diff --git a/demos/real-world/layout/demo.js b/demos/real-world/layout/demo.js
index 695863f25..df1a9f90a 100644
--- a/demos/real-world/layout/demo.js
+++ b/demos/real-world/layout/demo.js
@@ -1,5 +1,5 @@
(function($){
- var updateUpDown = function(sortable){
+ function updateUpDown(sortable){
$('dl:not(.ui-sortable-helper)', sortable)
.removeClass('first').removeClass('last')
.find('.up, .down').removeClass('disabled').end()
@@ -7,7 +7,7 @@
.filter(':last').addClass('last').find('.down').addClass('disabled').end().end();
};
- var moveUpDown = function(){
+ function moveUpDown(){
var link = $(this),
dl = link.parents('dl'),
prev = dl.prev('dl'),
@@ -22,7 +22,7 @@
updateUpDown(dl.parent());
};
- var addItem = function(){
+ function addItem(){
var sortable = $(this).parents('.ui-sortable');
var options = '<span class="options"><a class="up">up</a><a class="down">down</a></span>';
var tpl = '<dl class="sort"><dt>{name}' + options + '</dt><dd>{desc}</dd></dl>';
@@ -32,11 +32,11 @@
updateUpDown(sortable);
};
- var emptyTrashCan = function(item){
+ function emptyTrashCan(item){
item.remove();
};
- var sortableChange = function(e, ui){
+ function sortableChange(e, ui){
if(ui.sender){
var w = ui.element.width();
ui.placeholder.width(w);
@@ -44,7 +44,7 @@
}
};
- var sortableUpdate = function(e, ui){
+ function sortableUpdate(e, ui){
if(ui.element[0].id == 'trashcan'){
emptyTrashCan(ui.item);
} else {
@@ -92,6 +92,6 @@
$('#overlay').fadeOut(function(){
$('body').css('overflow', 'auto');
});
- }, 750);
+ }, 500);
});
})(jQuery); \ No newline at end of file
diff --git a/demos/real-world/layout/index.html b/demos/real-world/layout/index.html
index 7e305c956..7e8edb8fa 100644
--- a/demos/real-world/layout/index.html
+++ b/demos/real-world/layout/index.html
@@ -16,7 +16,9 @@
<link rel="icon" href="http://jquery.com/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="demo.css" type="text/css" media="screen" />
- <!-- saved from url=(0013)about:internet -->
+ <!--[if IE]>
+ <link rel="stylesheet" href="demo-ie.css" type="text/css" media="screen" />
+ <![endif]-->
</head>
<body id="uidemo">