diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-20 13:53:19 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-20 13:53:19 +0200 |
commit | 75b44c9f5f19ec9403c08550d44013c3c23a3d2e (patch) | |
tree | 4e9704ae74194e453840b76cb2d5d414b7741ff7 /pyload/web/app/scripts/collections/FileList.js | |
parent | try to fix bug when refreshing page (diff) | |
download | pyload-75b44c9f5f19ec9403c08550d44013c3c23a3d2e.tar.xz |
small fixes
Diffstat (limited to 'pyload/web/app/scripts/collections/FileList.js')
-rw-r--r-- | pyload/web/app/scripts/collections/FileList.js | 10 |
1 files changed, 10 insertions, 0 deletions
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() { } |