Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added minimal width method

  • Loading branch information...
commit 5aba6620a3a31f810652b89a060c575d657b02d4 1 parent 11aa2c9
@hofmeister authored
Showing with 19 additions and 1 deletion.
  1. +19 −1 js/lib/utils.js
View
20 js/lib/utils.js
@@ -846,9 +846,9 @@
input.blur(function (evt) {
elm.removeClass('wb-focus');
});
-
};
+
$.fn.isOutside = function (container, newOffset) {
var thisBBox = $(this).boundingBox(false);
@@ -947,6 +947,24 @@
return $(this).has(elms).length > 0;
};
+ $.fn.minimalWidth = function() {
+ var $this = $(this);
+ if ($this.css('display') !== 'block') {
+ return $this.outerWidth();
+ }
+ var minWidth = 0;
+ $this.children().each(function() {
+ var $child = $(this);
+ var width = $child.minimalWidth();
+ if (width > minWidth) {
+ minWidth = width;
+ }
+ });
+
+ return minWidth;
+ };
+
+
$.fn.visibleBox = function () {
var $this = $(this);
var vbox = $this.boundingBox();
Please sign in to comment.
Something went wrong with that request. Please try again.