// Generated by CoffeeScript 1.3.3
var __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

define(['environ', 'mediator', 'jquery', 'backbone', 'views/queryviews'], function(environ, mediator, $, Backbone, QueryViews) {
  var DiscoverArea;
  return DiscoverArea = (function(_super) {

    __extends(DiscoverArea, _super);

    function DiscoverArea() {
      return DiscoverArea.__super__.constructor.apply(this, arguments);
    }

    DiscoverArea.prototype.id = 'discover-area';

    DiscoverArea.prototype.initialize = function() {
      var $queryViewsListToggle,
        _this = this;
      DiscoverArea.__super__.initialize.apply(this, arguments);
      this.$el.hide().css('margin-left', '250px').css('margin-right', '250px').appendTo('#main-area .inner');
      this.queryViewsPanel = new QueryViews.Panel({
        collection: App.DataConcept
      });
      this.queryViewsList = new QueryViews.List;
      $queryViewsListToggle = $('<button class=btn><i class=icon-filter></i></button>');
      this.$toolbar = $('<ul>').addClass('nav pull-right').hide().appendTo('#subnav .container-fluid');
      $queryViewsListToggle.on('click', function(event) {
        return _this.queryViewsList.$el.panel('toggle');
      });
      return this.$toolbar.append($('<li>').html($queryViewsListToggle));
    };

    DiscoverArea.prototype.load = function() {
      this.$el.fadeIn();
      this.queryViewsPanel.$el.panel('open');
      this.queryViewsList.$el.panel('open');
      return this.$toolbar.hide();
    };

    DiscoverArea.prototype.unload = function() {
      this.$el.hide();
      this.queryViewsPanel.$el.panel('close');
      this.queryViewsList.$el.panel('close');
      return this.$toolbar.fadeIn();
    };

    return DiscoverArea;

  })(Backbone.View);
});
