o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1388436944.887496:@value"
{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"mercury/select.js; FI"
pathname; FI"/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/mercury-6daffeeb487e/app/assets/javascripts/mercury/select.js.coffee; FI"content_type; FI"application/javascript; FI"
mtime; FI"2013-11-20T08:09:45-05:00; FI"length; Fi I"digest; F"%403ecec4e9b92e51453495a8efea6f4fI"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.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"dependency_digest; F"%d00d0b086f4c0667dfd8b4623d6fbf8fI"required_paths; F[I"/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/mercury-6daffeeb487e/app/assets/javascripts/mercury/select.js.coffee; FI"dependency_paths; F[{I" path; FI"/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/mercury-6daffeeb487e/app/assets/javascripts/mercury/select.js.coffee; FI"
mtime; FI"2013-11-20T08:09:45-05:00; FI"digest; F"%6e5f4cee0246e893feeed56ddfa2ab44I"
_version; F"%6776f581a4329e299531e1d52aa59832