Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created May 16, 2010 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ELLIOTTCABLE/402657 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/402657 to your computer and use it in GitHub Desktop.
properties: {
title: {
type: 'string',
maxLength: 140,
conditional: {
optional: true,
when: function () { // The 'optional' attribute only takes effect if this function returns true
return !this.published; // So the title is only optional if the article hasn't been published.
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment