本文整理匯總了TypeScript中app/utils/addFocusEffect.addFocusEffect函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript addFocusEffect函數的具體用法?TypeScript addFocusEffect怎麽用?TypeScript addFocusEffect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了addFocusEffect函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: createTextareaElement
function createTextareaElement(value) {
var textFieldStyle = _.pick(TextFieldInput.STYLE,
'color', 'padding', 'font', 'backgroundImage',
'borderRadius', 'borderWidth', 'outlineWidth'
);
var style = _.extend(textFieldStyle, {
display: 'block',
marginLeft: '1em',
marginBottom: '5px',
lineHeight: '1.75',
width: '340px',
height: '5.8em',
resize: 'none'
});
var textarea = createDOMElement('textarea', style);
if (value) textarea.value = value;
addFocusEffect(textarea, {
boxShadow: '0 0 3px 2px #b5d5ff'
});
return textarea;
}
示例2: createElement
function createElement(value) {
var domElement = createDOMElement('input', TextFieldInput.STYLE);
if (value) domElement.value = value;
addFocusEffect(domElement, {
boxShadow: '0 0 3px 2px #b5d5ff'
});
return domElement;
}
示例3: before
before(function() {
initialStyle = {
'color': 'blue'
};
focusStyle = {
'color': 'red'
};
domElement = createDOMElement('button', initialStyle);
addFocusEffect(domElement, focusStyle);
});
示例4: addEventListeners
function addEventListeners(toggleButton, optionList) {
toggleButton.addEventListener('click', optionList.toggle);
toggleButton.addEventListener('keydown', ifKey('ArrowDown', selectFirstOption));
toggleButton.addEventListener('keydown', ifKey('ArrowUp', selectLastOption));
toggleButton.addEventListener('keydown', ifKey('Enter', optionList.executeSelectedOption));
hideOnEscapeOrOutsideClick(optionList);
addFocusEffect(toggleButton, {
boxShadow: 'rgb(181, 213, 255) 0px 0px 3px 2px'
});
function selectFirstOption() {
optionList.show();
optionList.selectNext();
}
function selectLastOption() {
optionList.show();
optionList.selectPrevious();
}
}