Skip to content

Instantly share code, notes, and snippets.

@visnup
Created December 20, 2008 22:53
Show Gist options
  • Save visnup/38445 to your computer and use it in GitHub Desktop.
Save visnup/38445 to your computer and use it in GitHub Desktop.
an in place editor that doesn't submit
var editor = new Ajax.InPlaceEditor('chart_name', '', {
okControl: false,
cancelControl: false,
submitOnBlur: true,
highlightcolor: 'transparent'
});
// override the bound submit handler function to prevent
// the control from actually submitting to a url and instead
// do something more useful with the edit.
editor._boundSubmitHandler = function(e) {
var value = $F(editor._controls.editor);
editor.element.update(value);
chart.record.name = value;
editor._boundWrapperHandler();
if (e) e.stop();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment