diff --git a/browser/base/content/tabview/modules/utils.jsm b/browser/base/content/tabview/modules/utils.jsm index ee0318f81ab..7985eb1c0b1 100644 --- a/browser/base/content/tabview/modules/utils.jsm +++ b/browser/base/content/tabview/modules/utils.jsm @@ -322,6 +322,20 @@ Range.prototype = { return false; }, + // ---------- + // Function: overlaps + // Whether the overlaps with the given or value or not. + // + // Paramaters + // - a number or + overlaps: function Rect_overlaps(value) { + if (Utils.isNumber(value)) + return this.contains(value); + if (Utils.isRange(value)) + return !(value.max < this.min || this.max < value.min); + return false; + }, + // ---------- // Function: proportion // Maps the given value to the range [0,1], so that it returns 0 if the value is <= the min, diff --git a/browser/base/content/tabview/trench.js b/browser/base/content/tabview/trench.js index e4812ac814e..b08ff4fef1f 100644 --- a/browser/base/content/tabview/trench.js +++ b/browser/base/content/tabview/trench.js @@ -382,7 +382,7 @@ Trench.prototype = { ruleOverlaps: function Trench_ruleOverlaps(position, range) { return (this.position - this.radius < position && position < this.position + this.radius && - this.activeRange.contains(range)); + this.activeRange.overlaps(range)); }, //----------