Index: ui/file_manager/file_manager/foreground/js/navigation_list_model.js |
diff --git a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js |
index 77e4f29c2dec7e2ab8c888ad3e9102f854caf86a..33c68809f005c030fcc9c10f2449b71a82d0c0d2 100644 |
--- a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js |
+++ b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js |
@@ -18,6 +18,22 @@ NavigationModelItem.prototype = { |
}; |
/** |
+ * Check whether given two model items are same. |
+ * @param {NavigationModelItem} item1 The first item to be compared. |
+ * @param {NavigationModelItem} item2 The second item to be compared. |
+ * @return {boolean} True if given two model items are same. |
+ */ |
+NavigationModelItem.isSame = function(item1, item2) { |
+ if (item1.isVolume != item2.isVolume) |
+ return false; |
+ |
+ if (item1.isVolume) |
+ return item1.volumeInfo === item2.volumeInfo; |
+ else |
+ return util.isSameEntry(item1.entry, item2.entry); |
+}; |
+ |
+/** |
* Item of NavigationListModel for shortcuts. |
* |
* @param {string} label Label. |