forked from maccman/holla
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.js
More file actions
36 lines (29 loc) · 1021 Bytes
/
Copy pathmenu.js
File metadata and controls
36 lines (29 loc) · 1021 Bytes
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
34
35
36
jQuery(function($){
var elements = $("#content .east [data-menu]");
elements.live("click", function(){
var state = $(this).attr("data-menu");
App.state.change(state);
});
App.state.bind("change", function(name){
elements.removeClass("active");
elements.filter("[data-menu='" + name + "']").addClass("active");
});
});
jQuery(function($){
var element = $("#channels");
element.delegate("li", "click", function(){
var channel = $(this).item();
App.state.change("channel", channel);
});
var currentChannel = function(){
return(App.state.find("channel").current);
};
var connector = element.connect(Channel);
connector.builder = function(element, item) {
var channel = currentChannel();
var channelState = App.state.current.name == "channel";
element.toggleClass("active", channelState && channel &&
item.id == channel.id);
};
App.state.bind("change", function(){ connector.render(); });
});