| OLD | NEW |
| 1 | 1 |
| 2 // Helpers | 2 // Helpers |
| 3 | 3 |
| 4 function $(id) { | 4 function $(id) { |
| 5 return document.getElementById(id); | 5 return document.getElementById(id); |
| 6 } | 6 } |
| 7 | 7 |
| 8 // TODO(arv): Remove these when classList is available in HTML5. | 8 // TODO(arv): Remove these when classList is available in HTML5. |
| 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 | 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 |
| 10 function hasClass(el, name) { | 10 function hasClass(el, name) { |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 * 'SyncLinkClicked'). | 721 * 'SyncLinkClicked'). |
| 722 * linkurl: the URL to use as the element's href (only used if linkurlisset is | 722 * linkurl: the URL to use as the element's href (only used if linkurlisset is |
| 723 * true). | 723 * true). |
| 724 */ | 724 */ |
| 725 function syncMessageChanged(newMessage) { | 725 function syncMessageChanged(newMessage) { |
| 726 var syncStatusElement = $('sync-status'); | 726 var syncStatusElement = $('sync-status'); |
| 727 var style = syncStatusElement.style; | 727 var style = syncStatusElement.style; |
| 728 | 728 |
| 729 // Hide the section if the message is emtpy. | 729 // Hide the section if the message is emtpy. |
| 730 if (!newMessage.syncsectionisvisible) { | 730 if (!newMessage.syncsectionisvisible) { |
| 731 style.display = 'none'; |
| 731 return; | 732 return; |
| 732 } | 733 } |
| 733 style.display = 'block'; | 734 style.display = 'block'; |
| 734 | 735 |
| 735 // Set the sync section background color based on the state. | 736 // Set the sync section background color based on the state. |
| 736 if (newMessage.msgtype == 'error') { | 737 if (newMessage.msgtype == 'error') { |
| 737 style.backgroundColor = 'tomato'; | 738 style.backgroundColor = 'tomato'; |
| 738 } else { | 739 } else { |
| 739 style.backgroundColor = ''; | 740 style.backgroundColor = ''; |
| 740 } | 741 } |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 function fixLinkUnderline(el) { | 1683 function fixLinkUnderline(el) { |
| 1683 var span = document.createElement('span'); | 1684 var span = document.createElement('span'); |
| 1684 span.className = 'link-color'; | 1685 span.className = 'link-color'; |
| 1685 while (el.hasChildNodes()) { | 1686 while (el.hasChildNodes()) { |
| 1686 span.appendChild(el.firstChild); | 1687 span.appendChild(el.firstChild); |
| 1687 } | 1688 } |
| 1688 el.appendChild(span); | 1689 el.appendChild(span); |
| 1689 } | 1690 } |
| 1690 | 1691 |
| 1691 updateAttribution(); | 1692 updateAttribution(); |
| OLD | NEW |