OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
7 | 7 |
8 /** | 8 /** |
9 * FileManager constructor. | 9 * FileManager constructor. |
10 * | 10 * |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 li.appendChild(div); | 1866 li.appendChild(div); |
1867 | 1867 |
1868 if (rootType == DirectoryModel.RootType.ARCHIVE || | 1868 if (rootType == DirectoryModel.RootType.ARCHIVE || |
1869 rootType == DirectoryModel.RootType.REMOVABLE) { | 1869 rootType == DirectoryModel.RootType.REMOVABLE) { |
1870 var spacer = this.document_.createElement('div'); | 1870 var spacer = this.document_.createElement('div'); |
1871 spacer.className = 'spacer'; | 1871 spacer.className = 'spacer'; |
1872 li.appendChild(spacer); | 1872 li.appendChild(spacer); |
1873 | 1873 |
1874 var eject = this.document_.createElement('div'); | 1874 var eject = this.document_.createElement('div'); |
1875 eject.className = 'root-eject'; | 1875 eject.className = 'root-eject'; |
1876 eject.addEventListener('click', | 1876 eject.addEventListener('click', function(event) { |
1877 this.unmountVolume_.bind(this, entry.toURL())); | 1877 event.stopPropagation(); |
| 1878 this.unmountVolume_(entry.toURL()); |
| 1879 }.bind(this)); |
| 1880 // Block other mouse handlers. |
| 1881 eject.addEventListener('mouseup', function(e) { e.stopPropagation() }); |
| 1882 eject.addEventListener('mousedown', function(e) { e.stopPropagation() }); |
1878 li.appendChild(eject); | 1883 li.appendChild(eject); |
1879 | 1884 |
1880 cr.ui.contextMenuHandler.setContextMenu(li, this.rootsContextMenu_); | 1885 cr.ui.contextMenuHandler.setContextMenu(li, this.rootsContextMenu_); |
1881 } | 1886 } |
1882 | 1887 |
1883 cr.defineProperty(li, 'lead', cr.PropertyKind.BOOL_ATTR); | 1888 cr.defineProperty(li, 'lead', cr.PropertyKind.BOOL_ATTR); |
1884 cr.defineProperty(li, 'selected', cr.PropertyKind.BOOL_ATTR); | 1889 cr.defineProperty(li, 'selected', cr.PropertyKind.BOOL_ATTR); |
1885 return li; | 1890 return li; |
1886 }; | 1891 }; |
1887 | 1892 |
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4432 }); | 4437 }); |
4433 }, onError); | 4438 }, onError); |
4434 | 4439 |
4435 function onError(err) { | 4440 function onError(err) { |
4436 console.log('Error while checking free space: ' + err); | 4441 console.log('Error while checking free space: ' + err); |
4437 setTimeout(doCheck, 1000 * 60); | 4442 setTimeout(doCheck, 1000 * 60); |
4438 } | 4443 } |
4439 } | 4444 } |
4440 } | 4445 } |
4441 })(); | 4446 })(); |
OLD | NEW |