Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
Ajax.InPlaceEditor.Listeners = { click: 'enterEditMode', mouseover: 'enterHover', mouseout: 'leaveHover' }; Ajax.InPlaceEditor.prototype.initialize = Ajax.InPlaceEditor.prototype.initialize.wrap( function(){ var args = $A(arguments), proceed = args.shift(); proceed(args[0], args[1], args[2] ? args[2] : null); this._boundKeyListener = this.checkForEscapeOrReturn.bindAsEventListener(this); }); Ajax.InPlaceEditor.prototype.enterEditMode = Ajax.InPlaceEditor.prototype.enterEditMode.wrap( function(){ var args = $A(arguments), proceed = args.shift(); proceed( args[0] ? args[0] : null ); this._controls.editor.observe('keydown', this._boundKeyListener); }); Ajax.InPlaceEditor.prototype.removeForm = Ajax.InPlaceEditor.prototype.removeForm.wrap( function(){ var args = $A(arguments), proceed = args.shift(); this._controls.editor.stopObserving('keydown', this._boundKeyListener); proceed(); });
This paste will be private.
From the Design Piracy series on my blog: