本文整理汇总了TypeScript中ember-views.isSimpleClick函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isSimpleClick函数的具体用法?TypeScript isSimpleClick怎么用?TypeScript isSimpleClick使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isSimpleClick函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isAllowedEvent
function isAllowedEvent(event: Event, allowedKeys: any) {
if (allowedKeys === null || allowedKeys === undefined) {
if (POINTER_EVENT_TYPE_REGEX.test(event.type)) {
return isSimpleClick(event);
} else {
allowedKeys = '';
}
}
if (allowedKeys.indexOf('any') >= 0) {
return true;
}
for (let i = 0; i < MODIFIERS.length; i++) {
if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) {
return false;
}
}
return true;
}
示例2: _invoke
if (get(this, 'willBeActive') === false && get(this, '_active')) {
return 'ember-transitioning-out';
} else {
return false;
}
}),
/**
Event handler that invokes the link, activating the associated route.
@method _invoke
@param {Event} event
@private
*/
_invoke(this: any, event: Event): boolean {
if (!isSimpleClick(event)) { return true; }
let preventDefault = get(this, 'preventDefault');
let targetAttribute = get(this, 'target');
if (preventDefault !== false) {
if (!targetAttribute || targetAttribute === '_self') {
event.preventDefault();
}
}
if (get(this, 'bubbles') === false) { event.stopPropagation(); }
if (this._isDisabled) { return false; }
if (get(this, 'loading')) {
示例3: _invoke
return 'ember-transitioning-out';
} else {
return false;
}
}
),
/**
Event handler that invokes the link, activating the associated route.
@method _invoke
@param {Event} event
@private
*/
_invoke(this: any, event: Event): boolean {
if (!isSimpleClick(event)) {
return true;
}
let preventDefault = get(this, 'preventDefault');
let targetAttribute = get(this, 'target');
if (preventDefault !== false) {
if (!targetAttribute || targetAttribute === '_self') {
event.preventDefault();
}
}
if (get(this, 'bubbles') === false) {
event.stopPropagation();
}