本文整理汇总了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();
}
}