aboutsummaryrefslogtreecommitdiff
path: root/mod/embed
diff options
context:
space:
mode:
Diffstat (limited to 'mod/embed')
-rw-r--r--mod/embed/start.php2
-rw-r--r--mod/embed/views/default/js/embed/embed.php9
2 files changed, 7 insertions, 4 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php
index a3ccab66b..e8a3f8c14 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -47,7 +47,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
'name' => 'embed',
'href' => $url,
'text' => elgg_echo('embed:media'),
- 'rel' => 'lightbox',
+ 'rel' => "embed-lightbox-{$vars['id']}",
'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}",
'priority' => 10,
));
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 0c8442292..eb6153abf 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -67,6 +67,8 @@ echo elgg_view('embed/custom_insert_js');
* @return bool
*/
elgg.embed.submit = function(event) {
+ $('.embed-wrapper .elgg-form-file-upload').hide();
+ $('.embed-throbber').show();
$(this).ajaxSubmit({
dataType : 'json',
@@ -82,6 +84,10 @@ elgg.embed.submit = function(event) {
var url = elgg.normalize_url('embed/tab/' + forward);
url = elgg.embed.addContainerGUID(url);
$('.embed-wrapper').parent().load(url);
+ } else {
+ // incorrect response, presumably an error has been displayed
+ $('.embed-throbber').hide();
+ $('.embed-wrapper .elgg-form-file-upload').show();
}
}
},
@@ -90,9 +96,6 @@ elgg.embed.submit = function(event) {
}
});
- $('.elgg-form-file-upload').hide();
- $('.embed-throbber').show();
-
// this was bubbling up the DOM causing a submission
event.preventDefault();
event.stopPropagation();