| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // UI modifications and event listeners that take place after load. | |
| 6 function setupEvents() { | |
| 7 $('proceed-button').hidden = false; | |
| 8 $('proceed-button').addEventListener('click', function() { | |
| 9 sendCommand(CMD_PROCEED); | |
| 10 }); | |
| 11 | |
| 12 var details = document.querySelector('details.more'); | |
| 13 if ($('more-info-title').textContent == '') { | |
| 14 details.hidden = true; | |
| 15 } else { | |
| 16 details.addEventListener('toggle', function handleToggle() { | |
| 17 if (!details.open) | |
| 18 return; | |
| 19 sendCommand(CMD_MORE); | |
| 20 details.removeEventListener('toggle', handleToggle); | |
| 21 }, false); | |
| 22 } | |
| 23 | |
| 24 $('exit-button').addEventListener('click', function() { | |
| 25 sendCommand(CMD_DONT_PROCEED); | |
| 26 }); | |
| 27 } | |
| 28 | |
| 29 document.addEventListener('DOMContentLoaded', setupEvents); | |
| OLD | NEW |