Permalink
Browse files

small changes in archive view

  • Loading branch information...
julien51 committed Oct 6, 2011
1 parent 4940baa commit 36be81f91e66a52543475a6f82618ef66e9b46e6
Showing with 18 additions and 15 deletions.
  1. +18 −15 views/js/archive-view.js
View
@@ -39,22 +39,25 @@ var ArchiveView = Backbone.View.extend({
var view = new MessageView({
model: message
});
- view.bind("change", function () {
- $('#container').isotope('reLayout');
- });
- view.bind("rendered", function () {
- this.complete_page();
- $('#container').isotope('appended', $(view.el), function () {
- $(view.el).show();
+ if($("#"+message.id).length === 0) {
+ console.log(message.attributes.created_at);
+ view.bind("change", function () {
+ $('#container').isotope('reLayout');
+ });
+ view.bind("rendered", function () {
+ this.complete_page();
+ $('#container').isotope('appended', $(view.el), function () {
+ $(view.el).show();
+ }.bind(this));
}.bind(this));
- }.bind(this));
- $(view.el).hide();
- $("#container").append(view.el); // Adds the view in the document.
- view.bind("delete-from-feed", function (url) {
- this.delete_from_feed(url);
- $('#container').isotope('reLayout');
- }.bind(this));
- view.render(); // builds the HTML
+ $(view.el).hide();
+ $("#container").append(view.el); // Adds the view in the document.
+ view.bind("delete-from-feed", function (url) {
+ this.delete_from_feed(url);
+ $('#container').isotope('reLayout');
+ }.bind(this));
+ view.render(); // builds the HTML
+ }
},
delete_from_feed: function (feed) {
_.each(this.collection.models, function (model) {

0 comments on commit 36be81f

Please sign in to comment.