Rafał Pitoń 10 лет назад
Родитель
Сommit
b407742f8f
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      misago/static/misago/js/misago-onebox.js

+ 3 - 4
misago/static/misago/js/misago-onebox.js

@@ -40,14 +40,14 @@ $(function() {
     });
     });
 
 
     this.activate = function($element) {
     this.activate = function($element) {
-      $element.replaceWith(this.$element);
+      $element.replaceWith(this.$element.clone());
     }
     }
 
 
   }
   }
 
 
   MisagoOnebox = function() {
   MisagoOnebox = function() {
 
 
-    this.boxes = {}
+    this.boxes = {};
 
 
     var _this = this;
     var _this = this;
 
 
@@ -95,7 +95,7 @@ $(function() {
 
 
       $element.find('a').each(function() {
       $element.find('a').each(function() {
 
 
-        var href = $.trim($element.text());
+        var href = $.trim($(this).text());
         if (_this.boxes[href] === undefined) {
         if (_this.boxes[href] === undefined) {
           $.each(_this.oneboxes, function(i, onebox) {
           $.each(_this.oneboxes, function(i, onebox) {
             _this.boxes[href] = _this.youtube(href);
             _this.boxes[href] = _this.youtube(href);
@@ -110,7 +110,6 @@ $(function() {
         }
         }
 
 
       });
       });
-
     }
     }
 
 
   };
   };