o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984302.800698: @value"ú{I" class:EFI"ProcessedAsset;FI"logical_path;FI"!locomotive/editable_field.js;TI" pathname;FI"d/Users/papipo/Projects/locomotive/engine/vendor/assets/javascripts/locomotive/editable_field.js;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-18T09:21:51+01:00;FI" length;Fi¨I" digest;F"%40863c70b7fe65b8b776a96d0ff0c892I" source;FI"¨/** * Version 0.0.1 * tiny effect to display an input field when clicking on a label * Didier Lafforgue */ $.fn.editableField = function(settings) { var destroy = false; if ('destroy' == settings) { destroy = true } else { settings = $.extend({}, settings); } function getText(element) { if (element.is('select')) { return element[0].options[element[0].options.selectedIndex].text; } else { return element.val(); } } return this.each(function() { if (destroy) { $(this).unbind('mouseenter').unbind('mouseleave'); $(this).prev('.editable').unbind('click').remove(); } else { var input = $(this).hide(); var label = $('').addClass('editable').html(getText(input)); var timer = null; input.before(label); label.bind('click', function() { label.hide(); input.show().focus(); }); input.hover(function() { clearTimeout(timer); }, function() { timer = setTimeout(function() { input.hide(); label.show() }, 1000); }).change(function() { input.hide(); label.show().html(getText(input)) }); } }); } ; ;FI"dependency_digest;F"%05660e045ec2eeda554bca5f3710a428I"required_paths;F[I"d/Users/papipo/Projects/locomotive/engine/vendor/assets/javascripts/locomotive/editable_field.js;TI"dependency_paths;F[{I" path;FI"d/Users/papipo/Projects/locomotive/engine/vendor/assets/javascripts/locomotive/editable_field.js;TI" mtime;FI"2013-01-18T09:21:51+01:00;FI" digest;F"%70281adfad17e311a06bb22ddd0c35ebI" _version;F"%6776f581a4329e299531e1d52aa59832