-define(['Core', 'Dom/Traverse', 'Dom/Util', 'Ui/SimpleDropdown', './Input'], function(Core, DomTraverse, DomUtil, UiSimpleDropdown, UiSearchInput) {
+define(['Core', 'Dom/Traverse', 'Dom/Util', 'Ui/Screen', 'Ui/SimpleDropdown', './Input'], function(Core, DomTraverse, DomUtil, UiScreen, UiSimpleDropdown, UiSearchInput) {
"use strict";
return {
callbackDropdownInit: function(dropdownMenu) {
dropdownMenu.classList.add('dropdownMenuPageSearch');
- elData(dropdownMenu, 'dropdown-alignment-horizontal', 'right');
-
- var minWidth = searchInput.clientWidth;
- dropdownMenu.style.setProperty('min-width', minWidth + 'px', '');
-
- // calculate offset to ignore the width caused by the submit button
- var parent = searchInput.parentNode;
- var offsetRight = (DomUtil.offset(parent).left + parent.clientWidth) - (DomUtil.offset(searchInput).left + minWidth);
- var offsetTop = DomUtil.styleAsInt(window.getComputedStyle(parent), 'padding-bottom');
- dropdownMenu.style.setProperty('transform', 'translateX(-' + Math.ceil(offsetRight) + 'px) translateY(-' + offsetTop + 'px)', '');
+ if (UiScreen.is('screen-lg')) {
+ elData(dropdownMenu, 'dropdown-alignment-horizontal', 'right');
+
+ var minWidth = searchInput.clientWidth;
+ dropdownMenu.style.setProperty('min-width', minWidth + 'px', '');
+
+ // calculate offset to ignore the width caused by the submit button
+ var parent = searchInput.parentNode;
+ var offsetRight = (DomUtil.offset(parent).left + parent.clientWidth) - (DomUtil.offset(searchInput).left + minWidth);
+ var offsetTop = DomUtil.styleAsInt(window.getComputedStyle(parent), 'padding-bottom');
+ dropdownMenu.style.setProperty('transform', 'translateX(-' + Math.ceil(offsetRight) + 'px) translateY(-' + offsetTop + 'px)', '');
+ }
},
callbackSelect: function() {
setTimeout(function() {