OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 var expandedDetails = false; |
| 6 var click = 'click'; |
| 7 |
| 8 function setupEvents() { |
| 9 $('safety-button').addEventListener(click, function() { |
| 10 sendCommand(CMD_DONT_PROCEED); |
| 11 }); |
| 12 |
| 13 $('proceed-link').addEventListener(click, function() { |
| 14 sendCommand(CMD_PROCEED); |
| 15 }); |
| 16 |
| 17 $('details-button').addEventListener(click, function() { |
| 18 var hiddenDetails = $('details').classList.toggle('hidden'); |
| 19 $('details-button').innerText = hiddenDetails ? |
| 20 templateData.openDetails : templateData.closeDetails; |
| 21 if (!expandedDetails) { |
| 22 // Record a histogram entry only the first time that details is opened. |
| 23 sendCommand(CMD_MORE); |
| 24 expandedDetails = true; |
| 25 } |
| 26 }); |
| 27 } |
| 28 |
| 29 document.addEventListener('DOMContentLoaded', setupEvents); |
OLD | NEW |