o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1392321397.157423:@value"}{I"
class:EFI"ProcessedAsset;�FI"logical_path;�FI"/iugu-ux/components/usecode/iugu-ui-base.js;�TI"
pathname;�FI"q/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-base.js.coffee;�TI"content_type;�FI"application/javascript;�FI"
mtime;�FI"2014-01-14T09:59:34-02:00;�FI"length;�Fi�I"digest;�F"%8e4739a141de41f04f2a09d9b0536b89I"source;�FI"�(function() {
  var _ref,
    __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; };

  IuguUI.Base = (function(_super) {
    __extends(Base, _super);

    function Base() {
      _ref = Base.__super__.constructor.apply(this, arguments);
      return _ref;
    }

    Base.prototype.defaults = {
      baseURL: ""
    };

    Base.prototype.initialize = function() {
      Base.__super__.initialize.apply(this, arguments);
      _.bindAll(this);
      this.options = _.extend({}, this.defaults, this.options);
      if (this.options.layout) {
        this.layout = this.options.layout;
      }
      if (this.options.parent) {
        this.parent = this.options.parent;
      }
      if (this.options.context) {
        this.context = this.options.context;
      }
      if (this.options.title) {
        this.title = this.options.title;
      }
      if (this.options.identifier) {
        this.identifier = (function() {
          return this.options.identifier + ':';
        });
      }
      this.handleEvent('initialize');
      return this;
    };

    Base.prototype.handleDeprecated = function() {
      if (window.app._iscroll_instances === void 0) {
        window.app._iscroll_instances = [];
      }
      if (!window.IS_DEPRECATED_ANDROID) {
        return;
      }
      return this.$(".handle-scrolling").each(function(index, handle_scrolling_elm) {
        var elm;
        elm = handle_scrolling_elm.parentNode;
        if ($(handle_scrolling_elm).attr("initialized") !== true) {
          $(handle_scrolling_elm).css('overflow-y', 'visible');
          $(handle_scrolling_elm).css('height', 'auto');
          $(handle_scrolling_elm).attr("initialized", true);
          return window.app._iscroll_instances.push(new iScroll(elm, {
            hideScrollbar: false,
            hScroll: false
          }));
        }
      });
    };

    Base.prototype.render = function() {
      var current_context, iscroll, _i, _len, _ref1;
      current_context = {};
      if (this.title) {
        current_context.title = this.title;
      }
      current_context = _.extend(current_context, this.context());
      $(this.el).html(this.getLayout()(current_context));
      if (this.className) {
        $(this.el).addClass(this.className);
      }
      this.handleDeprecated();
      if (window.app._iscroll_instances) {
        _ref1 = window.app._iscroll_instances;
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
          iscroll = _ref1[_i];
          if (iscroll.wrapper) {
            iscroll.refresh();
          }
        }
      }
      return this;
    };

    Base.prototype.renderPartial = function(layout, target, context) {
      if (context == null) {
        context = this.context;
      }
      $(target).html(this.getLayout(target)(context));
      return this.handleDeprecated();
    };

    Base.prototype.getLayout = function(layout_file) {
      if (layout_file == null) {
        layout_file = this.layout;
      }
      if (JST["web-app/presenters/" + layout_file]) {
        return JST["web-app/presenters/" + layout_file];
      }
      return JST["iugu-ux/components/presenters/" + layout_file];
    };

    Base.prototype.context = function() {
      return {};
    };

    Base.prototype.historyNavigate = function(url) {
      return Backbone.history.navigate(this.options.baseURL + '/' + url);
    };

    Base.prototype.root = function() {
      return _.result(this.parent, 'root') || this;
    };

    Base.prototype.identifier = function() {
      return _.result(this.parent, 'identifier') || '';
    };

    Base.prototype.delegateChild = function(selector, view) {
      var selectors;
      selectors = {};
      if (_.isObject(selector)) {
        selectors = selector;
      } else {
        selectors[selector] = view;
      }
      if (!selectors) {
        return;
      }
      return _.each(selectors, function(view, selector) {
        return view.setElement(this.$(selector)).render();
      }, this);
    };

    Base.prototype.mapDOMEvent = function(type) {
      switch (type) {
        case 'click':
          return 'click';
        case 'mouseover':
          return 'mouseover';
        case 'mouseout':
          return 'mouseout';
        default:
          return type;
      }
    };

    Base.prototype.handleEvent = function(triggerType) {
      return this.root().trigger(this.identifier() + triggerType, this);
    };

    Base.prototype.handleDOMEvent = function(e) {
      var triggerType;
      e.preventDefault();
      triggerType = this.mapDOMEvent(e.type);
      return this.handleEvent(triggerType);
    };

    Base.prototype.trigger = function(events) {
      if ((typeof enable_debug_events !== "undefined" && enable_debug_events !== null) && enable_debug_events) {
        debug('Triggered Event: ' + arguments[0]);
      }
      return Base.__super__.trigger.apply(this, arguments);
    };

    Base.prototype.unload = function() {
      debug('Called IuguUI.Base:unload');
      this.undelegateEvents();
      return this.off();
    };

    Base.prototype.close = function() {
      debug('Called IuguUI.Base:close');
      if (this.className) {
        $(this.el).removeClass(this.className);
      }
      this.unload();
      return this.remove();
    };

    return Base;

  })(Backbone.View);

  this.IuguUI.Base = IuguUI.Base;

}).call(this);
;�TI"dependency_digest;�F"%dfbe3cb72b50f250bf6dc0bd7052c3e1I"required_paths;�F[I"q/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-base.js.coffee;�TI"dependency_paths;�F[{I"	path;�FI"q/Users/nkr/Projetos/Iugu/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-base.js.coffee;�TI"
mtime;�FI"2014-01-14T09:59:34-02:00;�FI"digest;�F"%6668749e1af148f6ca5caa5f50c30fb7I"
_version;�F"%9f3b95dd7ea3030dc35985c0a8020862