Created
August 12, 2010 11:49
-
-
Save geapi/520833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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