Skip to content

Instantly share code, notes, and snippets.

@geapi
Created August 12, 2010 11:49
Show Gist options
  • Save geapi/520833 to your computer and use it in GitHub Desktop.
Save geapi/520833 to your computer and use it in GitHub Desktop.
searchField: SC.TextFieldView.design({
layout: { centerY: 0, height: 24, right: 120, width: 200 },
controlSize: SC.LARGE_CONTROL_SIZE,
fontWeight: SC.BOLD_WEIGHT,
hint: 'type your search here',
valueBinding: 'TwSprout.pubmedController.searchTerm',
target: "TwSprout.pubmedController",
action: "newSearch",
keyDown: function(evt) {
sc_super(); // necessary to guarantee regular handling of keyDown events,
// want to avoid that this overwrite messes everything up
if (evt.charCode === 13) {
// trigger the search after we've seen an "enter", seems to have hickups in FF
TwSprout.pubmedController.searchPubmed();
return YES;
} else {
return NO;
}
}
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment