Skip to content

Instantly share code, notes, and snippets.

@MacDada
Created December 14, 2012 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MacDada/4288304 to your computer and use it in GitHub Desktop.
Save MacDada/4288304 to your computer and use it in GitHub Desktop.
<span data-bind="foreach: textVerticalTrimOptions">
<button data-bind="
text: name,
value: value,
click: $parent.setTextVerticalTrim
"></button>
</span>
<script>
VM = function() {
var self = this;
/* some non important stuff… */
this.textVerticalTrim = ko.observable(0),
this.setTextVerticalTrim = function(button) {
self.textVerticalTrim(button.value);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment