o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1388437012.977736: @value"È{I" class:EFI"BundledAsset;FI"logical_path;FI" mercury/toolbar.expander.js;FI" pathname;FI"‘/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/mercury-rails-0.9.0/app/assets/javascripts/mercury/toolbar.expander.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-12-30T11:31:51-05:00;FI" length;Fi¥ I" digest;F"%05960cd73b1d853f14ec073e32a59f48I" source;FI"¥ (function() { 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; }; this.Mercury.Toolbar.Expander = (function(_super) { __extends(Expander, _super); function Expander(name, options) { this.name = name; this.options = options; this.container = this.options["for"]; Expander.__super__.constructor.call(this, null, this.name, this.options); return this.element; } Expander.prototype.build = function() { var _ref; this.container.css({ whiteSpace: 'normal', visibility: 'hidden', display: 'block' }); this.containerWidth = this.container.outerWidth(); this.container.css({ visibility: 'visible' }); this.trigger = jQuery('
', { "class": 'mercury-toolbar-expander' }).appendTo((_ref = jQuery(this.options.appendTo).get(0)) != null ? _ref : 'body'); this.element = jQuery('
', { "class": "mercury-palette mercury-expander mercury-" + this.name + "-expander", style: 'display:none' }); return this.windowResize(); }; Expander.prototype.bindEvents = function() { var _this = this; Mercury.on('hide:dialogs', function(event, dialog) { if (dialog !== _this) { return _this.hide(); } }); Mercury.on('resize', function() { return _this.windowResize(); }); Expander.__super__.bindEvents.apply(this, arguments); this.trigger.click(function(event) { var button, hiddenButtons, _i, _len, _ref; event.stopPropagation(); hiddenButtons = []; _ref = _this.container.find('.mercury-button'); for (_i = 0, _len = _ref.length; _i < _len; _i++) { button = _ref[_i]; button = jQuery(button); if (button.position().top > 5) { hiddenButtons.push(button.data('expander')); } } _this.loadContent(hiddenButtons.join('')); return _this.toggle(); }); return this.element.click(function(event) { var button, buttonName; buttonName = jQuery(event.target).closest('[data-button]').data('button'); button = _this.container.find(".mercury-" + buttonName + "-button"); return button.click(); }); }; Expander.prototype.windowResize = function() { if (this.containerWidth > jQuery(window).width()) { this.trigger.show(); } else { this.trigger.hide(); } return this.hide(); }; Expander.prototype.position = function(keepVisible) { var position, width; this.element.css({ top: 0, left: 0, display: 'block', visibility: 'hidden' }); position = this.trigger.position(); width = this.element.width(); if (position.left + width > jQuery(window).width()) { position.left = position.left - width + this.trigger.width(); } return this.element.css({ top: position.top + this.trigger.height(), left: position.left, display: keepVisible ? 'block' : 'none', visibility: 'visible' }); }; return Expander; })(Mercury.Palette); }).call(this); ;FI"required_assets_digest;F"%e9beddaec149fef80d84e8a039d2a551I" _version;F"%6776f581a4329e299531e1d52aa59832