{I" class:ETI"BundledAsset;FI"logical_path;TI"mercury/select.js;FI" pathname;TI"†/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/select.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+½¡9RI" length;Tiù I" digest;TI"%9cb6e8213f25a09cbc01e375cbec4929;FI" source;TI"ù (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.Select = (function(_super) { __extends(Select, _super); function Select(url, name, options) { this.url = url; this.name = name; this.options = options != null ? options : {}; Select.__super__.constructor.apply(this, arguments); } Select.prototype.build = function() { var _ref; this.element = jQuery('
', { "class": "mercury-select mercury-" + this.name + "-select loading", style: 'display:none' }); return this.element.appendTo((_ref = jQuery(this.options.appendTo).get(0)) != null ? _ref : 'body'); }; Select.prototype.bindEvents = function() { var _this = this; Mercury.on('hide:dialogs', function(event, dialog) { if (dialog !== _this) { return _this.hide(); } }); this.element.on('mousedown', function(event) { return event.preventDefault(); }); return Select.__super__.bindEvents.apply(this, arguments); }; Select.prototype.position = function(keepVisible) { var documentHeight, elementHeight, elementWidth, height, left, position, top; this.element.css({ top: 0, left: 0, display: 'block', visibility: 'hidden' }); position = this.button.position(); elementWidth = this.element.width(); elementHeight = this.element.height(); documentHeight = jQuery(document).height(); top = position.top + (this.button.height() / 2) - (elementHeight / 2); if (top < position.top - 100) { top = position.top - 100; } if (top < 20) { top = 20; } height = this.loaded ? 'auto' : elementHeight; if (top + elementHeight >= documentHeight - 20) { height = documentHeight - top - 20; } left = position.left; if (left + elementWidth > jQuery(window).width()) { left = left - elementWidth + this.button.width(); } return this.element.css({ top: top, left: left, height: height, display: keepVisible ? 'block' : 'none', visibility: 'visible' }); }; return Select; })(Mercury.Dialog); }).call(this); ;TI"required_assets_digest;TI"%35682bc3594cd9ab22c209148ca682c4;FI" _version;TI"%2cf3622cbba861b85d33ffabfa420c13;F