Index: trunk/tools/wp-photocommons/js/admin.js |
— | — | @@ -13,9 +13,7 @@ |
14 | 14 | '</a>' |
15 | 15 | )); |
16 | 16 | |
17 | | - var searchDialog = {}; |
18 | | - $('<div id="photocommons-dialog"></div>').appendTo('body').load(PATH + '/search.php?standalone=1', function(){ |
19 | | - |
| 17 | + $('<div id="photocommons-dialog"></div>').appendTo('body').load(PATH + '/search.php?standalone=1', function() { |
20 | 18 | PhotoCommons.init(); |
21 | 19 | |
22 | 20 | dialog = $('#photocommons-dialog').dialog({ |
— | — | @@ -24,13 +22,12 @@ |
25 | 23 | height : 500, |
26 | 24 | autoOpen: false |
27 | 25 | }); |
28 | | - |
29 | 26 | }); |
30 | 27 | |
31 | 28 | $('#photocommons-add').live('click', function(e) { |
32 | 29 | e.preventDefault(); |
33 | 30 | |
34 | | - searchDialog.dialog('open'); |
| 31 | + $("#photocommons-dialog").dialog('open'); |
35 | 32 | |
36 | 33 | $('#wp-photocommons-images .image').live('click', function() { |
37 | 34 | var file = $(this).attr('data-filename'), |
— | — | @@ -48,7 +45,7 @@ |
49 | 46 | tinyMCE.execCommand('mceInsertContent', false, shortcode); |
50 | 47 | } |
51 | 48 | |
52 | | - searchDialog.dialog('close'); |
| 49 | + $("#photocommons-dialog").dialog('close'); |
53 | 50 | }); |
54 | 51 | }); |
55 | 52 | } |