{I" class:EFI"BundledAsset; FI"logical_path; FI" active_admin/lib/popover.js; TI" pathname; FI"œ/Users/benoit/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/bundler/gems/activeadmin-7d968c2898cb/app/assets/javascripts/active_admin/lib/popover.js.coffee; TI"content_type; FI"application/javascript; FI" mtime; Fl+°àåTI"length; Fi‹ I"digest; F"%19ce04c43879b3c5aa13c7cae9a2f21fI"source; FI"‹ (function() { ActiveAdmin.Popover = (function() { function Popover(options, element) { var defaults; this.options = options; this.element = element; this.$element = $(this.element); defaults = { fadeInDuration: 20, fadeOutDuration: 100, autoOpen: true, pageWrapperElement: "#wrapper", onClickActionItemCallback: null }; this.options = $.extend(defaults, options); this.isOpen = false; if (!(this.$popover = $(this.$element.attr('href'))).length) { this.$popover = this.$element.next('.popover'); } this._buildPopover(); this._bind(); } Popover.prototype.open = function() { this.isOpen = true; this.$popover.fadeIn(this.options.fadeInDuration); this._positionPopover(); this._positionNipple(); return this; }; Popover.prototype.close = function() { this.isOpen = false; this.$popover.fadeOut(this.options.fadeOutDuration); return this; }; Popover.prototype.destroy = function() { this.$element.removeData('popover'); this.$element.unbind(); this.$element = null; return this; }; Popover.prototype._buildPopover = function() { this.$nipple = $('
'); this.$popover.prepend(this.$nipple); this.$popover.hide(); return this.$popover.addClass('popover'); }; Popover.prototype._bind = function() { $(this.options.pageWrapperElement).click((function(_this) { return function() { if (_this.isOpen) { return _this.close(); } }; })(this)); if (this.options.autoOpen) { return this.$element.click((function(_this) { return function(e) { e.stopPropagation(); if (_this.isOpen) { return _this.close(); } else { return _this.open(); } }; })(this)); } }; Popover.prototype._positionPopover = function() { var button_center, popover_center; button_center = this.$element.offset().left + this.$element.outerWidth() / 2; popover_center = this.$popover.outerWidth() / 2; return this.$popover.css('left', button_center - popover_center); }; Popover.prototype._positionNipple = function() { this.$popover.css('top', this.$element.offset().top + this.$element.outerHeight() + 10); return this.$nipple.css('left', this.$popover.outerWidth() / 2 - this.$nipple.outerWidth() / 2); }; return Popover; })(); $.widget.bridge('popover', ActiveAdmin.Popover); }).call(this); ; TI"required_assets_digest; F"%38970831e89cda102746ac24548e0199I" _version; F"%a805bf9eb4f9751b8ea0c520b2a29a36