]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #5114. IE 7 and 8 forward to the embed items list after an upload.
authorBrett Profitt <brett.profitt@gmail.com>
Wed, 27 Feb 2013 14:44:43 +0000 (09:44 -0500)
committerBrett Profitt <brett.profitt@gmail.com>
Wed, 27 Feb 2013 14:44:43 +0000 (09:44 -0500)
mod/embed/views/default/js/embed/embed.php

index eb6153abf26d85a44b6452566c623d82f3a7b788..e84427f24ded4c3e85564b08a4eadae5b3730066 100644 (file)
@@ -1,3 +1,4 @@
+//<script>
 elgg.provide('elgg.embed');
 
 elgg.embed.init = function() {
@@ -90,6 +91,18 @@ elgg.embed.submit = function(event) {
                                        $('.embed-wrapper .elgg-form-file-upload').show();
                                }
                        }
+
+                       // ie 7 and 8 have a null response because of the use of an iFrame
+                       // so just show the list after upload.
+                       // http://jquery.malsup.com/form/#file-upload claims you can wrap JSON
+                       // in a textarea, but a quick test didn't work, and that is fairly
+                       // intrusive to the rest of the ajax system.
+                       else if (response === undefined && $.browser.msie) {
+                               var forward = $('input[name=embed_forward]').val();
+                               var url = elgg.normalize_url('embed/tab/' + forward);
+                               url = elgg.embed.addContainerGUID(url);
+                               $('.embed-wrapper').parent().load(url);
+                       }
                },
                error    : function(xhr, status) {
                        // @todo nothing for now