(function() {
  var cs;

  cs = window.CS || (window.CS = {});

  cs.Data || (cs.Data = {});

  cs.Views || (cs.Views = {});

  cs.Views.GridPostView = Backbone.View.extend({
    initialize: function(options) {
      this.options = options;
      _.bindAll(this);
      this.$el = $(this.el);
      if (cs.Data.loaded) {
        return this.setupTextPost();
      } else {
        this.options.appModel.bind('site-preloader-animation-in-complete', this.setupTextPost);
      }
    },
    setupTextPost: function() {
      var $h2, size, top;
      if (this.$el.data('type') === 'text') {
        $h2 = this.$('.text-promo h2');
        size = $h2.find('.title').text().length;
        if (size > 28) $h2.addClass('long');
        top = 0 - ($h2.height() / 2);
        $h2.css({
          marginTop: "" + top + "px"
        });
        $h2.addClass('ready');
      }
    }
  });

}).call(this);

