aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/js
diff options
context:
space:
mode:
authorMatt Beckett <beck24@gmail.com>2012-07-17 14:19:24 -0600
committerMatt Beckett <beck24@gmail.com>2012-07-17 14:19:24 -0600
commitd8da958e206b8f9b8b2e578a6572bcae1c08df0d (patch)
treea7830d9f839ffc6b221147eaf9735834382749ea /mod/embed/views/default/js
parent4859e56edf1b17092751a6e9d7d89b03113253db (diff)
downloadelgg-d8da958e206b8f9b8b2e578a6572bcae1c08df0d.tar.gz
elgg-d8da958e206b8f9b8b2e578a6572bcae1c08df0d.tar.bz2
Fixes #4725 - no longer removes file upload form outside of embed lightbox, no longer hangs on throbber when the form returns an error.
Diffstat (limited to 'mod/embed/views/default/js')
-rw-r--r--mod/embed/views/default/js/embed/embed.php9
1 files changed, 6 insertions, 3 deletions
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();