From 75b44c9f5f19ec9403c08550d44013c3c23a3d2e Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 20 Jul 2013 13:53:19 +0200 Subject: small fixes --- pyload/web/app/scripts/collections/FileList.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pyload/web/app/scripts/collections/FileList.js') diff --git a/pyload/web/app/scripts/collections/FileList.js b/pyload/web/app/scripts/collections/FileList.js index 873f4c0e3..112dc5e51 100644 --- a/pyload/web/app/scripts/collections/FileList.js +++ b/pyload/web/app/scripts/collections/FileList.js @@ -9,6 +9,16 @@ define(['jquery', 'backbone', 'underscore', 'models/File'], function($, Backbone return file.get('fileorder'); }, + isEqual: function(fileList) { + if (this.length !== fileList.length) return false; + + // Assuming same order would be faster in false case + var diff = _.difference(this.models, fileList.models); + + // If there is a difference models are unequal + return diff.length > 0; + }, + initialize: function() { } -- cgit v1.2.3