timeline change

This commit is contained in:
devin committed 2012-07-05 16:49:03 +08:00
1 parent 312e63f242
commit bfaed4deb4
6 files changed
+158 -23

No files matched your search

+40 -12
View File
@@ -26,7 +26,7 @@ var orbitTimeline = function(dom){
totalul = $("#scale_wrapper ul").length
$(".t_scale").width((totalul*350) + totalyearwidth);
}
t.bubble_fx();
$('.tinycanvas').tinyscrollbar({
axis: 'x',
onMove: function(x){
@@ -38,9 +38,10 @@ var orbitTimeline = function(dom){
for(eve in t.events){
t.makeBubble(t.events[eve]);
totalul = $("#scale_wrapper ul").length
$(".t_scale").width((totalul*350) + totalyearwidth);
$(".t_scale").width((totalul*360) + totalyearwidth + 314);
}
$('.tinycanvas').tinyscrollbar_update(x);
t.bubble_fx();
});
}
}
@@ -63,16 +64,16 @@ var orbitTimeline = function(dom){
t.events.push(bubbleData);
if(cur_year != year){
year = cur_year;
scale.append($("<div class='group year w1 h1 hp vp thmtxt thmc1'>"+(year+1)+"</div><div data-content='"+year+"'></div>"));
scale.append($("<div class='group year w1 h1 hp vp thmtxt thmc1'>"+(year+1)+"</div><div class='region_year group' data-content='"+year+"'></div>"));
}
if(cur_mon != mon){
mon = cur_mon;
var yr = scale.find("div[data-content="+year+"]");
yr.append($("<div class='group month' data-content='"+cdt+"'><div class='month_heading'>"+t.monthList[parseInt(formname)]+"</div><div class='bubble_list'></div></div>"))
yr.append($("<div class='group month' data-content='"+cdt+"'><div class='month_heading vp hp'>"+t.monthList[parseInt(formname)]+"</div><div class='bubble_list'></div></div>"))
}
});
});
scale.append($("<div class='group year w1 h1 thmtxt thmc1'>"+year+"</div><div data-content='"+(year-1)+"'></div>"));
scale.append($("<div class='group year w1 h1 hp vp thmtxt thmc1'>"+year+"</div><div class='region_year group' data-content='"+(year-1)+"'></div>"));
t.fromdate = [year,formname-1];
if(typeof callbackFn == "function"){
callbackFn.call(this,scale);
@@ -101,10 +102,10 @@ var orbitTimeline = function(dom){
bubble.show();
bubble.click(function(){
o.toolPopup({
parent: $(this),
html : "<div><h3>"+bubbleData.jtitle+"</h3><span><h2>Co-Authors: </h2>"+bubbleData.coauthors+"</span><span><h2>Abstract: </h2>"+bubbleData.abstract+"</span></div>",
height: "auto",
width:"300px"
parent: $(this).parent(),
html : "<div class='bubble_content'><h2>"+bubbleData.jtitle+"</h2><h3>Co-Authors</h3><span class='context'>"+bubbleData.coauthors+"</span><h3>Abstract</h3><span class='context'>"+bubbleData.abstract+"</span></div>",
height: "392px",
width:"310px"
});
})//.mouseout(function(){t.oapi.toolPopup("destroy");})
}
@@ -127,19 +128,19 @@ var orbitTimeline = function(dom){
if(cur_year != year){
year = cur_year;
if(scale.find("div[data-content="+year+"]").length == 0){
scale.append($("<div class='scale_region year'>"+(year+1)+"</div><div data-content='"+year+"'></div>"));
scale.append($("<div class='group year w1 h1 hp vp thmtxt thmc1'>"+(year+1)+"</div><div class='region_year group' data-content='"+year+"'></div>"));
}
}
if(cur_mon != mon){
mon = cur_mon;
var yr = scale.find("div[data-content="+year+"]");
yr.append($("<div class='scale_region month' data-content='"+cdt+"'><div class='month_heading'>"+t.monthList[parseInt(formname)]+"</div><div class='bubble_list'></div></div>"))
yr.append($("<div class='group month' data-content='"+cdt+"'><div class='month_heading vp hp'>"+t.monthList[parseInt(formname)]+"</div><div class='bubble_list'></div></div>"))
}
});
});
if(papersArray.length != 0){
if(scale.find("div[data-content="+(year-1)+"]").length == 0)
scale.append($("<div class='scale_region year'>"+year+"</div><div data-content='"+(year-1)+"'></div>"));
scale.append($("<div class='group year w1 h1 hp vp thmtxt thmc1'>"+year+"</div><div class='region_year group' data-content='"+(year-1)+"'></div>"));
t.ajaxload = true;
t.fromdate = [year,formname-1];
}
@@ -149,4 +150,31 @@ var orbitTimeline = function(dom){
})
}
this.bubble_fx = function(){
$('.bubble').on({
mouseover: function(){
$(this)
.addClass('hover')
.append('<span class="icon-chevron-right" />');
},
mouseout: function(){
$(this)
.removeClass('hover')
.find('.icon-chevron-right').remove();
},
click: function(){
$(this)
.parents('#timeline')
.find('.bubble, .date')
.removeClass('thmc1 thmtxt');
$(this)
.addClass('thmc1 thmtxt');
$(this)
.find('.date')
.addClass('thmtxt');
$(this)
.append('<div class="bubble_arrow"/>');
}
});
}
}
+2 -2
View File
@@ -172,8 +172,8 @@ var orbitDesktopAPI = function(){
settings.height = (!settings.height ? "50px" : settings.height);
settings.width = (!settings.width ? "150px" : settings.width);
settings.html = (!settings.html ? "" : settings.html);
var leftpos = settings.parent.width();
var toolpopup = $("<div class='desktop_toolpopup' style='height:"+settings.height+";width:"+settings.width+"; left:"+leftpos+"px;'><span>"+settings.html+"</span></div>");
var leftpos = settings.parent.outerWidth();
var toolpopup = $("<div class='desktop_toolpopup' style='height:"+settings.height+";width:"+settings.width+"; left:"+leftpos+"px;'>"+settings.html+"</div>");
settings.parent.css("position","relative");
settings.parent.prepend(toolpopup);
toolpopup.click(function(event){