Browse Source

Use bound events to handle buddlist show/hide mouse over.

pull/13/merge
Simon Eisenmann 11 years ago
parent
commit
395b9ccf2d
  1. 2
      html/main.html
  2. 13
      static/js/directives/buddylist.js

2
html/main.html

@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
</div>
<div class="ng-cloak nicescroll" id="rightslide">
<div class="rightslidepane" ng-show="roomstatus">
<div id="buddylist" ng-mouseenter="toggleBuddylist(true)" ng-mouseleave="toggleBuddylist(false)"><buddy-list/></div>
<div id="buddylist"><buddy-list/></div>
<div id="chat"><chat/></div>
</div>
</div>

13
static/js/directives/buddylist.js

@ -101,7 +101,18 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) { @@ -101,7 +101,18 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) {
var link = function(scope, iElement, iAttrs, controller) {
//console.log("buddyList directive link", arguments);
// Add events to buddy list parent container to show/hide.
var parent = iElement.parent();
parent.on("mouseenter mouseleave", function(event) {
if (event.type === "mouseenter") {
scope.layout.buddylist = true;
} else {
if (scope.layout.buddylistAutoHide) {
scope.layout.buddylist = false;
}
}
scope.$apply();
});
};

Loading…
Cancel
Save