o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1363378938.758379: @value"ò{I" class:EFI"ProcessedAsset;FI"logical_path;FI"7active_admin/components/jquery.aa.dropdown-menu.js;TI" pathname;FI"¦/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-26T16:21:10-08:00;FI" length;Fi²I" digest;F"%8bee94c8fdb895f952df92b76a5385beI" source;FI"²(function() { window.AA.DropdownMenu = AA.DropdownMenu = (function() { function DropdownMenu(options, element) { var defaults; this.options = options; this.element = element; this.$element = $(this.element); defaults = { fadeInDuration: 20, fadeOutDuration: 100, onClickActionItemCallback: null }; this.options = $.extend({}, defaults, options); this.$menuButton = this.$element.find(".dropdown_menu_button"); this.$menuList = this.$element.find(".dropdown_menu_list_wrapper"); this.isOpen = false; this._buildMenuList(); this._bind(); return this; } DropdownMenu.prototype.open = function() { this.isOpen = true; this.$menuList.fadeIn(this.options.fadeInDuration); this._positionMenuList(); this._positionNipple(); return this; }; DropdownMenu.prototype.close = function() { this.isOpen = false; this.$menuList.fadeOut(this.options.fadeOutDuration); return this; }; DropdownMenu.prototype.destroy = function() { this.$element.unbind(); this.$element = null; return this; }; DropdownMenu.prototype.isDisabled = function() { return this.$menuButton.hasClass("disabled"); }; DropdownMenu.prototype.disable = function() { return this.$menuButton.addClass("disabled"); }; DropdownMenu.prototype.enable = function() { return this.$menuButton.removeClass("disabled"); }; DropdownMenu.prototype.option = function(key, value) { if ($.isPlainObject(key)) { return this.options = $.extend(true, this.options, key); } else if (key != null) { return this.options[key]; } else { return this.options[key] = value; } }; DropdownMenu.prototype._buildMenuList = function() { this.$menuList.prepend("
"); return this.$menuList.hide(); }; DropdownMenu.prototype._bind = function() { var _this = this; $("body").bind('click', function() { if (_this.isOpen === true) { return _this.close(); } }); return this.$menuButton.bind('click', function() { if (!_this.isDisabled()) { if (_this.isOpen === true) { _this.close(); } else { _this.open(); } } return false; }); }; DropdownMenu.prototype._positionMenuList = function() { var centerOfButtonFromLeft, centerOfmenuListFromLeft, menuListLeftPos; centerOfButtonFromLeft = this.$menuButton.offset().left + this.$menuButton.outerWidth() / 2; centerOfmenuListFromLeft = this.$menuList.outerWidth() / 2; menuListLeftPos = centerOfButtonFromLeft - centerOfmenuListFromLeft; return this.$menuList.css("left", menuListLeftPos); }; DropdownMenu.prototype._positionNipple = function() { var $nipple, bottomOfButtonFromTop, centerOfmenuListFromLeft, centerOfnippleFromLeft, nippleLeftPos; centerOfmenuListFromLeft = this.$menuList.outerWidth() / 2; bottomOfButtonFromTop = this.$menuButton.offset().top + this.$menuButton.outerHeight() + 10; this.$menuList.css("top", bottomOfButtonFromTop); $nipple = this.$menuList.find(".dropdown_menu_nipple"); centerOfnippleFromLeft = $nipple.outerWidth() / 2; nippleLeftPos = centerOfmenuListFromLeft - centerOfnippleFromLeft; return $nipple.css("left", nippleLeftPos); }; return DropdownMenu; })(); (function($) { $.widget.bridge('aaDropdownMenu', AA.DropdownMenu); return $(function() { return $(".dropdown_menu").aaDropdownMenu(); }); })(jQuery); }).call(this); ;TI"dependency_digest;F"%e3157a4cb855c55a83cca47c3f34d0e3I"required_paths;F[I"¦/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee;TI"dependency_paths;F[{I" path;FI"¦/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee;TI" mtime;FI"2013-01-26T16:21:10-08:00;FI" digest;F"%192f8f77d29bdc7009f482e2ab6c58f1I" _version;F"%6776f581a4329e299531e1d52aa59832