Skip to content

Instantly share code, notes, and snippets.

@noelrappin noelrappin/editable.js
Last active Aug 4, 2017

Embed
What would you like to do?
class Editable {
constructor(text) {
@text = text
@originalText = ""
@status = "notEditing"
}
startEdit {
@status = "editing"
@originalText = @text
}
cancel {
@status = "notEditing"
@text = @originalText
@originalText = ""
}
save {
@status = "notEditing"
@originalText = ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.