o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1337178513.16918: @value"‹{I" class:EFI"ProcessedAsset;FI"logical_path;F";ems/active_admin/components/jquery.aa.dropdown-menu.jsI" pathname;F"‰/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.dropdown-menu.js.coffeeI"content_type;FI"application/javascript;FI" mtime;FI"2012-05-16T15:14:22+01:00;FI" length;Fi²I" digest;F"%fafe83a984d017271ed4a20aa2eaa686I" 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"%0ea3bbe976fbdf488ca03a21408c0a9dI"required_paths;F["‰/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.dropdown-menu.js.coffeeI"dependency_paths;F[{I" path;F"‰/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.dropdown-menu.js.coffeeI" mtime;FI"2012-05-16T15:14:22+01:00;FI" digest;F"%ac03c2162ca3c3a0c445c07bd3d7d9d3I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862