diff options
author | Matt Beckett <beck24@gmail.com> | 2012-11-30 13:38:16 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-11-30 13:42:52 +0100 |
commit | 5f2e17c76537a26b0a73ca6a79b38beb55253363 (patch) | |
tree | 8772b95a37cbd934b66f6e74ee89b057a18b56f3 /views/default | |
parent | 36520e367d2d05b6e4c1f3d6703ea395c303d77b (diff) | |
download | elgg-5f2e17c76537a26b0a73ca6a79b38beb55253363.tar.gz elgg-5f2e17c76537a26b0a73ca6a79b38beb55253363.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 'views/default')
-rw-r--r-- | views/default/js/embed/embed.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/views/default/js/embed/embed.php b/views/default/js/embed/embed.php index 42165fa42..394240fa4 100644 --- a/views/default/js/embed/embed.php +++ b/views/default/js/embed/embed.php @@ -24,6 +24,7 @@ * <http://www.gnu.org/licenses/>. */ ?> + elgg.provide('elgg.embed'); elgg.embed.init = function() { @@ -91,6 +92,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', @@ -106,6 +109,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(); } } }, @@ -114,9 +121,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(); |