Bug 21139: No table in toolbar
[koha_ffzg] / koha-tmpl / intranet-tmpl / lib / jquery / plugins / jquery.fixFloat.js
index 74633e7..c0df4ea 100644 (file)
                 "display": tbh.css("display"),
                     "visibility": "hidden"
             });
-            tbhBis.width(tbh.outerWidth(true));
-            tbhBis.height(tbh.outerHeight(true));
+            tbhBis.width(tbh.innerWidth(true));
+            tbhBis.height(tbh.innerHeight(true));
+            tbhBis.attr('id', tbh.attr('id')+'Bis'); // Avoid 2 elts with the same id
             tbh.after(tbhBis);
             tbh.width(tbh.width());
-            var tbl = tbh.find("th,td");
-            if (tbl.length > 0) {
-                tbl.each(function () {
-                    var $elt = $(this);
-                    $elt.width($elt.outerWidth(true));
-                });
-            }
             tbh.css({
                 'position': 'absolute',
                     'top': originalPosition,
                     tbh.removeClass("floating");
                 }
             });
+
+            $(window).resize(function() {
+                var p = $(tbh).parents('div').first();
+                $(tbh).width(p.width()-10);
+            });
         }
     };
 })(jQuery, window);