blob: 793e0e5e16b1e4cc3a47a44338934d6fd1e93a2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Setup handlers for the minimize and close topbar buttons.
*/
function initializeHandlers() {
$('minimize-button').addEventListener('click', function(e) {
e.preventDefault();
chrome.app.window.current().minimize();
});
$('minimize-button').addEventListener('mousedown', function(e) {
e.preventDefault();
});
$('close-button').addEventListener('click', function() {
window.close();
});
$('close-button').addEventListener('mousedown', function(e) {
e.preventDefault();
});
}
window.addEventListener('DOMContentLoaded', initializeHandlers);
|