//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.EditableInplace=function(e){return RB.Object.create(RB.Model,{displayEditor:function(e){this.$.addClass("editing"),e.find(".editor").bind("keyup",this.handleKeyup)},getEditor:function(){var t=this.$.children(".editors").first().html("");return 0===t.length&&(t=e("<div class='editors'></div>").appendTo(this.$)),t},handleKeyup:function(t){var i,n;switch(i=e(this).parents(".model").first(),n=i.data("this"),t.which){case 13:n.saveEdits();break;case 27:n.cancelEdit();break;default:return!0}}})}(jQuery);