本文整理匯總了TypeScript中mousetrap.reset函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript reset函數的具體用法?TypeScript reset怎麽用?TypeScript reset使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了reset函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: reset
app.onPageAfterAnimation('index', (page) => {
$('.searchbar-input input').focus()
Mousetrap.reset()
reset()
bindKeyboard()
correctPosition()
})
示例2: autorun
autorun(() => {
Mousetrap.reset();
values(instumentShortcuts.get()).forEach(shortcut => {
if (shortcut.keybinding) {
Mousetrap.bind(shortcut.keybinding, () => {
executeShortcut(shortcut);
return false;
});
}
});
});
示例3: configureCommands
function configureCommands(newSettings: Settings, commands: Command[]) {
Mousetrap.reset();
Mousetrap.bind("backspace", e => {
if (e.preventDefault) {
e.preventDefault();
} else {
// internet explorer
e.returnValue = false;
}
});
commands.forEach(command => {
const commandSetting = _.find(
newSettings.Commands,
c => c.Name == command.Id
);
if (commandSetting) {
command.KeyBinding = commandSetting.KeyBinding;
command.ShowOnActionBar(commandSetting.ShowOnActionBar);
}
Mousetrap.bind(command.KeyBinding, command.ActionBinding);
});
}
示例4:
$rootScope.$on('$routeChangeSuccess', () => {
Mousetrap.reset();
// rebind global shortcuts
this.setupGlobal();
});