mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
refactor(toggle): move to constants from enum
move to constants from enum
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { GestureController, GesturePriority, GESTURE_TOGGLE } from '../../gestures/gesture-controller';
|
||||
import { GestureController, GESTURE_PRIORITY_TOGGLE, GESTURE_TOGGLE } from '../../gestures/gesture-controller';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { PanGesture } from '../../gestures/drag-gesture';
|
||||
import { Platform } from '../../platform/platform';
|
||||
@ -24,7 +24,7 @@ export class ToggleGesture extends PanGesture {
|
||||
domController: domCtrl,
|
||||
gesture: gestureCtrl.createGesture({
|
||||
name: GESTURE_TOGGLE,
|
||||
priority: GesturePriority.Toggle,
|
||||
priority: GESTURE_PRIORITY_TOGGLE
|
||||
})
|
||||
});
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { Haptic } from '../../tap-click/haptic';
|
||||
import { Ion } from '../ion';
|
||||
import { isTrueProperty, assert } from '../../util/util';
|
||||
import { Item } from '../item/item';
|
||||
import { Key } from '../../platform/key';
|
||||
import { KEY_ENTER, KEY_SPACE } from '../../platform/key';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { ToggleGesture } from './toggle-gesture';
|
||||
|
||||
@ -293,7 +293,7 @@ export class Toggle extends Ion implements IonicTapInput, AfterContentInit, Cont
|
||||
* @private
|
||||
*/
|
||||
@HostListener('keyup', ['$event']) _keyup(ev: KeyboardEvent) {
|
||||
if (ev.keyCode === Key.SPACE || ev.keyCode === Key.ENTER) {
|
||||
if (ev.keyCode === KEY_SPACE || ev.keyCode === KEY_ENTER) {
|
||||
console.debug(`toggle, keyup: ${ev.keyCode}`);
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
Reference in New Issue
Block a user