OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 var GalleryUtil = {}; | 5 var GalleryUtil = {}; |
6 | 6 |
7 /** | 7 /** |
8 * Obtains the entry set from the entries passed from onLaunched events. | 8 * Obtains the entry set from the entries passed from onLaunched events. |
9 * If an single entry is specified, the function returns all entries in the same | 9 * If an single entry is specified, the function returns all entries in the same |
10 * directory. Otherwise the function returns the passed entries. | 10 * directory. Otherwise the function returns the passed entries. |
(...skipping 26 matching lines...) Expand all Loading... |
37 return entries.filter(function(entry) { | 37 return entries.filter(function(entry) { |
38 return originalEntries[0].toURL() === entry.toURL() || | 38 return originalEntries[0].toURL() === entry.toURL() || |
39 entry.name[0] !== '.'; | 39 entry.name[0] !== '.'; |
40 }); | 40 }); |
41 }); | 41 }); |
42 } else { | 42 } else { |
43 entriesPromise = Promise.resolve(originalEntries); | 43 entriesPromise = Promise.resolve(originalEntries); |
44 } | 44 } |
45 | 45 |
46 return entriesPromise.then(function(entries) { | 46 return entriesPromise.then(function(entries) { |
47 return entries.filter(FileType.isImage).sort(function(a, b) { | 47 return entries.filter(function(entry) { |
| 48 return FileType.isImage(entry) || FileType.isRaw(entry); |
| 49 }).sort(function(a, b) { |
48 return a.name.localeCompare(b.name); | 50 return a.name.localeCompare(b.name); |
49 }); | 51 }); |
50 }); | 52 }); |
51 }; | 53 }; |
OLD | NEW |