1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 02:10:24 +00:00

Add focus handling for HLItemView

This commit is contained in:
Daniel Pan
2016-04-14 11:43:11 +08:00
parent 9cea2733ca
commit 69d3215660

View File

@@ -17,6 +17,25 @@ define([
initialize: function(options) {
this.$el.on('mouseenter', _.bind(this.highlight, this));
this.$el.on('mouseleave', _.bind(this.rmHighlight, this));
this.$el.on('focus', '*', _.bind(this.focus, this));
},
focus: function() {
// if there are dropdown items or freezeItemHightlight is set, don't highlight
if (app.ui.currentDropdown || app.ui.freezeItemHightlight) {
console.log("app.ui.currentDropdown ");
return true;
}
if (app.ui.currentHighlightedItem) {
if (app.ui.currentHighlightedItem == this) {
return true;
} else {
app.ui.currentHighlightedItem.rmHighlight();
}
}
this.highlight();
return true;
},
highlight: function() {