##// END OF EJS Templates
commits: unified expand commit logic and UI....
marcink -
r3187:d9b9dddd default
parent child Browse files
Show More
@@ -623,11 +623,6 b' input::-moz-focus-inner { border:0; padd'
623 623 display: block;
624 624 }
625 625
626 //TODO: lisa: this should be in tables
627 .show_more_col {
628 width: 20px;
629 }
630
631 626 //FORMS
632 627
633 628 .medium-inline,
@@ -230,6 +230,8 b' table.dataTable {'
230 230 &.expand_commit {
231 231 padding-right: 0;
232 232 padding-left: 1em;
233 cursor: pointer;
234 width: 20px;
233 235 }
234 236 }
235 237
@@ -445,6 +447,8 b' table.trending_language_tbl {'
445 447
446 448 &.expand_commit {
447 449 padding-right: 0;
450 cursor: pointer;
451 width: 20px;
448 452 }
449 453 }
450 454 }
@@ -142,7 +142,8 b' var CommitsController = function () {'
142 142 })
143 143 };
144 144
145 this.expandCommit = function (node) {
145 this.expandCommit = function (node, reloadGraph) {
146 reloadGraph = reloadGraph || false;
146 147
147 148 var target_expand = $(node);
148 149 var cid = target_expand.data('commitId');
@@ -179,7 +180,10 b' var CommitsController = function () {'
179 180 });
180 181 target_expand.addClass('open');
181 182 }
182 // redraw the graph
183 self.reloadGraph();
183
184 if (reloadGraph) {
185 // redraw the graph
186 self.reloadGraph();
187 }
184 188 }
185 189 };
@@ -1,7 +1,6 b''
1 1 ## small box that displays changed/added/removed details fetched by AJAX
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4
5 4 % if c.prev_page:
6 5 <tr>
7 6 <td colspan="9" class="load-more-commits">
@@ -80,14 +79,12 b''
80 79 % endif
81 80 % endif
82 81 </td>
83 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
84 <div class="show_more_col">
82 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this, true); return false">
85 83 <i class="icon-expand-linked"></i>&nbsp;
86 </div>
87 84 </td>
88 85 <td class="td-description mid">
89 86 <div class="log-container truncate-wrap">
90 <div class="message truncate" id="c-${commit.raw_id}">${urlify_commit_message(commit.message, c.repo_name)}</div>
87 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${urlify_commit_message(commit.message, c.repo_name)}</div>
91 88 </div>
92 89 </td>
93 90
@@ -45,23 +45,12 b''
45 45 ${h.hidden('revisions',commit.raw_id)}
46 46 </code>
47 47 </td>
48 <td class="expand_commit"
49 data-commit-id="${commit.raw_id}"
50 title="${_( 'Expand commit message')}"
51 >
52 <div class="show_more_col">
48 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
53 49 <i class="icon-expand-linked"></i>
54 </div>
55 50 </td>
56 51 <td class="mid td-description">
57 52 <div class="log-container truncate-wrap">
58 <div
59 id="c-${commit.raw_id}"
60 class="message truncate"
61 data-message-raw="${commit.message}"
62 >
63 ${urlify_commit_message(commit.message, c.repo_name)}
64 </div>
53 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${urlify_commit_message(commit.message, c.repo_name)}</div>
65 54 </div>
66 55 </td>
67 56 </tr>
@@ -85,31 +74,7 b''
85 74 </div>
86 75
87 76 <script>
88 $('.expand_commit').on('click',function(e){
89 var target_expand = $(this);
90 var cid = target_expand.data('commitId');
91
92 // ## TODO: dan: extract styles into css, and just toggleClass('open') here
93 if (target_expand.hasClass('open')){
94 $('#c-'+cid).css({
95 'height': '1.5em',
96 'white-space': 'nowrap',
97 'text-overflow': 'ellipsis',
98 'overflow':'hidden'
99 });
100 target_expand.removeClass('open');
101 }
102 else {
103 $('#c-'+cid).css({
104 'height': 'auto',
105 'white-space': 'pre-line',
106 'text-overflow': 'initial',
107 'overflow':'visible'
108 });
109 target_expand.addClass('open');
110 }
111 });
112
77 commitsController = new CommitsController();
113 78 $('.compare_select').on('click',function(e){
114 79 var cid = $(this).attr('commit_id');
115 80 $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl'));
@@ -516,16 +516,12 b''
516 516 ${h.hidden('revisions', commit.raw_id)}
517 517 </code>
518 518 </td>
519 <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}">
520 <div class="show_more_col">
519 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}" onclick="commitsController.expandCommit(this); return false">
521 520 <i class="icon-expand-linked"></i>
522 </div>
523 521 </td>
524 522 <td class="mid td-description">
525 523 <div class="log-container truncate-wrap">
526 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">
527 ${h.urlify_commit_message(commit.message, c.repo_name)}
528 </div>
524 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${h.urlify_commit_message(commit.message, c.repo_name)}</div>
529 525 </div>
530 526 </td>
531 527 </tr>
@@ -534,32 +530,6 b''
534 530 </table>
535 531 </div>
536 532
537 <script>
538 $('.expand_commit').on('click',function(e){
539 var target_expand = $(this);
540 var cid = target_expand.data('commitId');
541
542 if (target_expand.hasClass('open')){
543 $('#c-'+cid).css({
544 'height': '1.5em',
545 'white-space': 'nowrap',
546 'text-overflow': 'ellipsis',
547 'overflow':'hidden'
548 });
549 target_expand.removeClass('open');
550 }
551 else {
552 $('#c-'+cid).css({
553 'height': 'auto',
554 'white-space': 'pre-line',
555 'text-overflow': 'initial',
556 'overflow':'visible'
557 });
558 target_expand.addClass('open');
559 }
560 });
561 </script>
562
563 533 % endif
564 534
565 535 % else:
@@ -656,6 +626,7 b''
656 626 versionController.init();
657 627
658 628 reviewersController = new ReviewersController();
629 commitsController = new CommitsController();
659 630
660 631 $(function(){
661 632
@@ -34,7 +34,7 b''
34 34 h.route_path('repo_commit',repo_name=entry['repository'],commit_id=entry['commit_id']))}
35 35 </td>
36 36 <td class="td-message expand_commit search open" data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="t-${h.md5_safe(entry['repository'])+entry['commit_id']}" title="${_('Expand commit message')}">
37 <div class="show_more_col">
37 <div>
38 38 <i class="icon-expand-linked"></i>&nbsp;
39 39 </div>
40 40 </td>
General Comments 0
You need to be logged in to leave comments. Login now