diff --git a/src/styles/components/_buddycondensed.scss b/src/styles/components/_buddycondensed.scss index 1712e3b2..23dfc57f 100644 --- a/src/styles/components/_buddycondensed.scss +++ b/src/styles/components/_buddycondensed.scss @@ -22,6 +22,15 @@ display: inline-block; position: fixed; padding-left: 20px; + @media (max-width: 1125px) { + display: none; + } + @media (max-width: 480px) { + display: none; + padding-left: 0; + position: relative; + width: 80%; + } } .buddycondensed { &.buddy { @@ -36,20 +45,36 @@ } } .defaultDisplayNum { + @media (max-width: 480px) { + padding: 10px 0px; + } } .overDefaultDisplayNum { background: #f8f8f8; display: none; + max-width: 80%; position: fixed; top: 49px; + @media (max-width: 480px) { + overflow-y: auto; + max-height: 400px; + top: 109px; + } } .desc { display: none; font-weight: bold; padding-left: 10px; cursor: default; + @media (max-width: 480px) { + position: absolute; + top: 50px; + } &.overNum { display: inline-block; + @media (max-width: 480px) { + display: block; + } } } .actions { @@ -61,13 +86,21 @@ cursor: default; height: 51px; padding: 0 15px; - bottom: 10px; + bottom: 12px; position: relative; white-space: nowrap; z-index: 10; + @media (max-width: 480px) { + height: 60px; + padding: 0 5px; + bottom: 22px; + } .btn-group { margin-bottom: 5px; width: 55px; + @media (max-width: 480px) { + display: block; + } } .btn-primary { padding: 2px 4px; @@ -79,10 +112,14 @@ } .displayName { margin-right: 10px; + @media (max-width: 480px) { + line-height: 22px; + display: block; + } } } .buddyPicture { - cursor: pointer; + cursor: default; overflow: visible; } } diff --git a/static/js/directives/buddycondensed.js b/static/js/directives/buddycondensed.js index 5da426f5..0d97044e 100644 --- a/static/js/directives/buddycondensed.js +++ b/static/js/directives/buddycondensed.js @@ -34,15 +34,14 @@ define(['angular', 'jquery', 'text!partials/buddycondensed.html', 'hoverIntent'] return session && session.Id ? session.Id : null; }; var empty = function(x) { - return x === null || x === undefined || isNaN(x) || x === ""; + return x === null || x === undefined || x === ""; }; var sortCondensed = function() { - var unnamed = buddycondensed.length; buddycondensed.sort(function(current, next) { - if(!current.Status || current.Status && empty(current.Status.displayName)) { + if (!current.Status || current.Status && empty(current.Status.displayName)) { return 1; } else { - if(next.Status && !empty(next.Status.displayName)) { + if (next.Status && !empty(next.Status.displayName)) { if (current.Status.displayName < next.Status.displayName) { return -1; } else if (current.Status.displayName > next.Status.displayName) { @@ -58,11 +57,10 @@ define(['angular', 'jquery', 'text!partials/buddycondensed.html', 'hoverIntent'] }; var joined = function(buddy) { buddycondensed.push(buddy); - buddycondensed.push(angular.extend({}, buddy)); }; var left = function(id) { for (var i in buddycondensed) { - if(buddycondensed[i].Id === id) { + if (buddycondensed[i].Id === id) { buddycondensed.splice(i,1); break; } @@ -74,14 +72,13 @@ define(['angular', 'jquery', 'text!partials/buddycondensed.html', 'hoverIntent'] var hasSession = false; for (var i in buddycondensed) { // replace session data with contact data - if(buddycondensed[i].Userid === data.Userid) { + if (buddycondensed[i].Userid === data.Userid) { buddycondensed[i] = data; - //console.log('contactadded replaced', 'data', data.Status && data.Status.displayName, 'buddycondensed[i]', buddycondensed[i].Status && buddycondensed[i].Status.displayName); hasSession = true; break; } } - if(!hasSession) { + if (!hasSession) { joined(data); } $scope.$apply(); @@ -96,14 +93,14 @@ define(['angular', 'jquery', 'text!partials/buddycondensed.html', 'hoverIntent'] }); }; $scope.listDefault = function() { - if(buddycondensed.length >= $scope.maxBuddiesToShow) { + if (buddycondensed.length >= $scope.maxBuddiesToShow) { return buddycondensed.slice(0, $scope.maxBuddiesToShow); } else { return buddycondensed; } }; $scope.listOverDefault = function() { - if(buddycondensed.length >= $scope.maxBuddiesToShow) { + if (buddycondensed.length >= $scope.maxBuddiesToShow) { return buddycondensed.slice($scope.maxBuddiesToShow); } else { return []; @@ -148,7 +145,7 @@ define(['angular', 'jquery', 'text!partials/buddycondensed.html', 'hoverIntent'] } else if (event.currentTarget === overDefaultDisplayNum.get(0)) { aboveElem2 = false; } - if(!aboveElem1 && !aboveElem2) { + if (!aboveElem1 && !aboveElem2) { overDefaultDisplayNum.hide(); } };