aboutsummaryrefslogtreecommitdiff
path: root/views/default/js/embed/embed.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/js/embed/embed.php')
-rw-r--r--views/default/js/embed/embed.php10
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();