Fix: Editing nodes with XNodeAttributes might lead to data corruption
[redakcja.git] / redakcja / static / js / wiki / view_editor_wysiwyg.js
index cb7c40f..c08945c 100644 (file)
              });
        $overlay.append($attributes);
 
+    var overlayParent = $box[0].offsetParent || $box.parent();
        $overlay.css({
             position: 'absolute',
             height: h,
             left: x,
             top: y,
             width: w
-        }).appendTo($box[0].offsetParent || $box.parent()).show();
+        }).appendTo(overlayParent).show();
         
 
         if ($origin.is('.motyw')) {
                             }
                            /* Set attributres back to the node */
                            var attrs = {};
-                           $(".html-editarea-attributes [name]")
+                           $(".html-editarea-attributes [name]", overlayParent)
                                .each(function(i, textField) {
                                    attrs[textField.name] = textField.value;
                                });
 
                 $('.accept-button', $overlay).click(function(){
                     save();
+                    $(document).unbind('click.blur-overlay');
                 });
 
                 $(document).bind('click.blur-overlay', function(event){