-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmix-master-dialog.js
33 lines (28 loc) · 998 Bytes
/
mix-master-dialog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function (jQuery) {
var $ = jQuery;
jQuery.createHighlighter = function createHighlighter(hud, focusedOverlay) {
return {
over: function(d) {
var node = d.realDOMNode;
if (focusedOverlay.element == node)
return;
focusedOverlay.set(node);
var parent = node.parentNode;
// TODO: This is a dumb hack to make the root node seem as
// simple as we tell the user it is. But we should actually just
// structure the DOM simply instead of intervening here.
if ($(node).is("div.content"))
node = document.createElement("div");
if ($(parent).is("div.content"))
parent = document.createElement("div");
if ($(parent).is("div.column"))
parent = null;
hud.onFocusChange({element: node, ancestor: parent});
},
out: function(d) {
focusedOverlay.unfocus();
hud.onFocusChange({element: null, ancestor: null});
}
};
}
})(jQuery);