aboutsummaryrefslogtreecommitdiffstats
path: root/demos/droppable
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-03-02 11:57:08 +0000
committerRichard Worth <rdworth@gmail.com>2009-03-02 11:57:08 +0000
commit1395a6047b7717978076b6007a2d248144c1ed4e (patch)
tree0caac3aa474406598acb5167d8a4a36a8a4511f8 /demos/droppable
parent8fecd015cff46323cd7a45b98322b86baf6a9562 (diff)
downloadjquery-ui-1395a6047b7717978076b6007a2d248144c1ed4e.tar.gz
jquery-ui-1395a6047b7717978076b6007a2d248144c1ed4e.zip
demos: droppable photo manager - fixed issue where dialog would not be centered when image first opened.
Diffstat (limited to 'demos/droppable')
-rw-r--r--demos/droppable/photo-manager.html22
1 files changed, 13 insertions, 9 deletions
diff --git a/demos/droppable/photo-manager.html b/demos/droppable/photo-manager.html
index cc6dfaa41..868085afc 100644
--- a/demos/droppable/photo-manager.html
+++ b/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