Skip to content
Permalink
Browse files

demos: droppable photo manager - fixed issue where dialog would not b…

…e centered when image first opened.
  • Loading branch information...
rdworth committed Mar 2, 2009
1 parent 8fecd01 commit 1395a6047b7717978076b6007a2d248144c1ed4e
Showing with 13 additions and 9 deletions.
  1. +13 −9 demos/droppable/photo-manager.html
@@ -84,15 +84,19 @@
var title = $link.siblings('img').attr('alt');
var $modal = $('img[src$="'+src+'"]');
$modal.length ? $modal.dialog('open') : $('<img alt="'+title+'" width="384" height="288" style="padding: 8px;" />').attr('src',src).appendTo('body').dialog({
title: title,
width: '400px',
modal: 'true',
overlay: {
backgroundColor: '#000',
opacity: 0.5
}
});
if ($modal.length) {
$modal.dialog('open')
} else {
var img = $('<img alt="'+title+'" width="384" height="288" style="display:none;padding: 8px;" />')
.attr('src',src).appendTo('body');
setTimeout(function() {
img.dialog({
title: title,
width: 400,
modal: true
});
}, 1);
}
}
// resolve the icons behavior with event delegation

0 comments on commit 1395a60

Please sign in to comment.
You can’t perform that action at this time.