##// END OF EJS Templates
Animated arrow icon
Jonathan Frederic -
Show More
@@ -21,6 +21,36 b' define(['
21 this.events = options.events;
21 this.events = options.events;
22 this.sessions = {};
22 this.sessions = {};
23 this.base_url = options.base_url || utils.get_body_data("baseUrl");
23 this.base_url = options.base_url || utils.get_body_data("baseUrl");
24
25 // Add collapse arrows.
26 $('#running .panel-group .panel .panel-heading a').each(function(index, el) {
27 var $link = $(el);
28 var $icon = $('<i />')
29 .addClass('fa fa-caret-down');
30 $link.append($icon);
31 $link.down = true;
32 $link.click(function () {
33 if ($link.down) {
34 $link.down = false;
35 // jQeury doesn't know how to animate rotations. Abuse
36 // jQueries animate function by using an unused css attribute
37 // to do the animation (borderSpacing).
38 $icon.animate({ borderSpacing: 90 }, {
39 step: function(now,fx) {
40 $icon.css('transform','rotate(-' + now + 'deg)');
41 }
42 }, 250);
43 } else {
44 $link.down = true;
45 // See comment above.
46 $icon.animate({ borderSpacing: 0 }, {
47 step: function(now,fx) {
48 $icon.css('transform','rotate(-' + now + 'deg)');
49 }
50 }, 250);
51 }
52 });
53 });
24 };
54 };
25
55
26 SesssionList.prototype.load_sessions = function(){
56 SesssionList.prototype.load_sessions = function(){
General Comments 0
You need to be logged in to leave comments. Login now