comparison static/js/download.js @ 483:0978d4880577

downloads: skip trying to fill in button if it's not there
author Kevin Bullock <kbullock+mercurial@ringworld.org>
date Sun, 14 May 2017 21:15:12 -0500
parents 1188817fdf3a
children
comparison
equal deleted inserted replaced
482:1188817fdf3a 483:0978d4880577
133 } 133 }
134 }; 134 };
135 135
136 (function (document, window) { 136 (function (document, window) {
137 var load = function () { 137 var load = function () {
138 var versElement = document.getElementById('download-version')
139 , descElement = document.getElementById('download-description');
140
141 if (!(versElement && descElement)) {
142 return;
143 }
144
138 Downloader.init(sources); 145 Downloader.init(sources);
139 window.dl = Downloader.select(); 146 window.dl = Downloader.select();
140 var versElement = document.getElementById('download-version') 147
141 , descElement = document.getElementById('download-description');
142 versElement.appendChild(document.createTextNode(dl.attr('version'))); 148 versElement.appendChild(document.createTextNode(dl.attr('version')));
143 descElement.appendChild(document.createTextNode(dl.attr('desc'))); 149 descElement.appendChild(document.createTextNode(dl.attr('desc')));
144 } 150 }
145 151
146 if (document.readyState !== 'complete') { 152 if (document.readyState !== 'complete') {