[extensions-web] uploader: Fix double popups in Firefox



commit 902f87815f10b0754e3c0cddc251b2fe72b201a5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jun 3 03:23:05 2012 -0400

    uploader: Fix double popups in Firefox
    
    Let's just stop fighting with bubbling.

 .../templates/extensions/detail_edit.html          |    6 +++---
 sweettooth/static/js/uploader.js                   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/sweettooth/extensions/templates/extensions/detail_edit.html b/sweettooth/extensions/templates/extensions/detail_edit.html
index 678f902..4254f3f 100644
--- a/sweettooth/extensions/templates/extensions/detail_edit.html
+++ b/sweettooth/extensions/templates/extensions/detail_edit.html
@@ -54,8 +54,8 @@
 {% block screenshot %}
 <div class="screenshot upload">
   <img src="{{ th.url }}" />
-  <input type="file" accept="image/*">
 </div>
+<input type="file" accept="image/*">
 {% endblock %}
 
 {% block no-screenshot %}
@@ -63,16 +63,16 @@
   <div class="text">
     <span>Upload a screenshot</span>
   </div>
-  <input type="file" accept="image/*">
 </div>
+<input type="file" accept="image/*">
 {% endblock %}
 
 
 {% block icon %}
 <div class="icon upload">
   <img src="{{ extension.icon.url }}">
-  <input type="file" accept="image/*">
 </div>
+<input type="file" accept="image/*">
 {% endblock %}
 
 {% block extra-ext-class %}can-edit{% endblock %}
diff --git a/sweettooth/static/js/uploader.js b/sweettooth/static/js/uploader.js
index 9a14a91..95de3c5 100644
--- a/sweettooth/static/js/uploader.js
+++ b/sweettooth/static/js/uploader.js
@@ -4,7 +4,7 @@ define(['jquery'], function($) {
     "use strict";
 
     $.fn.uploadify = function(url) {
-        var $elem = $(this), $input = $elem.find('input');
+        var $elem = $(this), $input = $elem.next('input');
 
         var BOUNDARY = ' -- 598275094719306587185414';
         // Stolen from http://demos.hacks.mozilla.org/openweb/imageUploader/js/extends/xhr.js



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]