From 6146ddf644755db53cdbacb1abdeb82cff1c5da7 Mon Sep 17 00:00:00 2001 From: Luke Noel-Storr Date: Thu, 10 Dec 2015 16:17:41 +0000 Subject: [PATCH 1/2] better alignment for right-align (align to element rather than threshold) --- src/dropdownToggle/dropdownToggle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdownToggle/dropdownToggle.js b/src/dropdownToggle/dropdownToggle.js index 3aafd1b..31f7ed2 100644 --- a/src/dropdownToggle/dropdownToggle.js +++ b/src/dropdownToggle/dropdownToggle.js @@ -64,7 +64,7 @@ angular.module('mm.foundation.dropdownToggle', [ 'mm.foundation.position', 'mm.f var left = Math.round(offset.left - parentOffset.left); var rightThreshold = $window.innerWidth - dropdownWidth - 8; if (left > rightThreshold) { - left = rightThreshold; + left = offset.left - parentOffset.left - dropdownWidth + offset.width; dropdown.removeClass('left').addClass('right'); } css.left = left + 'px'; From 4e6b582e2f34b26bf18c7439af2545945d4dba58 Mon Sep 17 00:00:00 2001 From: Luke Noel-Storr Date: Thu, 10 Dec 2015 16:11:16 +0000 Subject: [PATCH 2/2] stop toggle pip getting stuck to the right --- src/dropdownToggle/dropdownToggle.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dropdownToggle/dropdownToggle.js b/src/dropdownToggle/dropdownToggle.js index 31f7ed2..6862ef5 100644 --- a/src/dropdownToggle/dropdownToggle.js +++ b/src/dropdownToggle/dropdownToggle.js @@ -66,6 +66,8 @@ angular.module('mm.foundation.dropdownToggle', [ 'mm.foundation.position', 'mm.f if (left > rightThreshold) { left = offset.left - parentOffset.left - dropdownWidth + offset.width; dropdown.removeClass('left').addClass('right'); + } else { + dropdown.removeClass('right').addClass('left'); } css.left = left + 'px'; css.position = null;