-
Notifications
You must be signed in to change notification settings - Fork 0
/
ribbon.tis
51 lines (40 loc) · 1.8 KB
/
ribbon.tis
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Ribbon : Behavior
{
function attached()
{
this.selectAll(".tabs-holder > li")[1].attributes.addClass("active");
this.selectAll(".content-holder > .section")[0].attributes.addClass("active");
this.on("click", ".tabs-holder > li a", function() {
var allTabs = this.$p(ul);
var tab = this.attributes["href"];//.replace("#", "");
var tabContainer = $$(.content-holder > .section);
var activeTabContainer = self.select("%s", tab);
if (!this.$p(li).attributes.hasClass("static")) {
for (var tabs in allTabs.selectAll("li"))
tabs.attributes.removeClass("active");
this.$p(li).attributes.addClass("active");
for (var allSections in tabContainer) {
allSections.attributes.removeClass("active");
allSections.attributes["style"] = "display: none;";
}
activeTabContainer.attributes["style"] = undefined;
activeTabContainer.attributes.addClass("active");
}
});
this._dropdown();
}
function _dropdown()
{
this.on("click", ".ribbon-split.dropdown-toggle, .ribbon-icon-button.dropdown-toggle, .ribbon-button.dropdown-toggle", function() {
var dropdownParent = this.$p(div);
var dropdown = dropdownParent.select(".ribbon-dropdown");
if (this.attributes.hasClass("active")) {
this.attributes.removeClass("active");
dropdown.attributes["style"] = "display: none;";
} else {
this.attributes.addClass("active");
dropdown.attributes["style"] = "display: block;";
}
});
}
}