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 /** | 5 /** |
6 * FileManager constructor. | 6 * FileManager constructor. |
7 * | 7 * |
8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 icon.className = 'detail-icon'; | 1887 icon.className = 'detail-icon'; |
1888 icon.setAttribute('file-type-icon', FileType.getIcon(entry)); | 1888 icon.setAttribute('file-type-icon', FileType.getIcon(entry)); |
1889 return icon; | 1889 return icon; |
1890 }; | 1890 }; |
1891 | 1891 |
1892 FileManager.prototype.renderRoot_ = function(path) { | 1892 FileManager.prototype.renderRoot_ = function(path) { |
1893 var li = this.document_.createElement('li'); | 1893 var li = this.document_.createElement('li'); |
1894 li.className = 'root-item'; | 1894 li.className = 'root-item'; |
1895 var dm = this.directoryModel_; | 1895 var dm = this.directoryModel_; |
1896 var handleClick = function() { | 1896 var handleClick = function() { |
1897 if (li.selected) { | 1897 if (li.selected && path !== dm.getCurrentDirPath()) { |
1898 dm.changeDirectory(path); | 1898 dm.changeDirectory(path); |
1899 } | 1899 } |
1900 }; | 1900 }; |
1901 li.addEventListener('mousedown', handleClick); | 1901 li.addEventListener('mousedown', handleClick); |
1902 li.addEventListener(cr.ui.TouchHandler.EventType.TOUCH_START, handleClick); | 1902 li.addEventListener(cr.ui.TouchHandler.EventType.TOUCH_START, handleClick); |
1903 | 1903 |
1904 var rootType = PathUtil.getRootType(path); | 1904 var rootType = PathUtil.getRootType(path); |
1905 | 1905 |
1906 var div = this.document_.createElement('div'); | 1906 var div = this.document_.createElement('div'); |
1907 div.className = 'root-label'; | 1907 div.className = 'root-label'; |
(...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4231 } | 4231 } |
4232 | 4232 |
4233 var defaultActionSeparator = | 4233 var defaultActionSeparator = |
4234 this.dialogDom_.querySelector('#default-action-separator'); | 4234 this.dialogDom_.querySelector('#default-action-separator'); |
4235 | 4235 |
4236 this.defaultActionMenuItem_.hidden = !taskItem; | 4236 this.defaultActionMenuItem_.hidden = !taskItem; |
4237 defaultActionSeparator.hidden = !taskItem; | 4237 defaultActionSeparator.hidden = !taskItem; |
4238 } | 4238 } |
4239 })(); | 4239 })(); |
4240 | 4240 |
OLD | NEW |