Minor change
Browse files
assets/scripts/src/constants.js
CHANGED
@@ -3,7 +3,7 @@ export const OVERLAY_PADDING = 10;
|
|
3 |
export const OVERLAY_ANIMATE = true;
|
4 |
export const OVERLAY_ZINDEX = '999999999';
|
5 |
|
6 |
-
export const
|
7 |
|
8 |
export const ID_POPOVER = 'sholo-popover-item';
|
9 |
export const ID_OVERLAY = 'sholo-canvas-overlay';
|
|
|
3 |
export const OVERLAY_ANIMATE = true;
|
4 |
export const OVERLAY_ZINDEX = '999999999';
|
5 |
|
6 |
+
export const ESC_KEY_CODE = 27;
|
7 |
|
8 |
export const ID_POPOVER = 'sholo-popover-item';
|
9 |
export const ID_OVERLAY = 'sholo-canvas-overlay';
|
assets/scripts/src/sholo.js
CHANGED
@@ -2,7 +2,13 @@ import Overlay from './overlay';
|
|
2 |
import Element from './element';
|
3 |
import './polyfill';
|
4 |
import Popover from './popover';
|
5 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
/**
|
8 |
* Plugin class that drives the plugin
|
@@ -153,7 +159,7 @@ export default class Sholo {
|
|
153 |
* @param event
|
154 |
*/
|
155 |
onKeyUp(event) {
|
156 |
-
if (event.keyCode ===
|
157 |
this.overlay.clear();
|
158 |
}
|
159 |
}
|
|
|
2 |
import Element from './element';
|
3 |
import './polyfill';
|
4 |
import Popover from './popover';
|
5 |
+
import {
|
6 |
+
CLASS_CLOSE_BTN,
|
7 |
+
CLASS_NEXT_STEP_BTN,
|
8 |
+
CLASS_PREV_STEP_BTN,
|
9 |
+
ESC_KEY_CODE,
|
10 |
+
ID_POPOVER,
|
11 |
+
} from './constants';
|
12 |
|
13 |
/**
|
14 |
* Plugin class that drives the plugin
|
|
|
159 |
* @param event
|
160 |
*/
|
161 |
onKeyUp(event) {
|
162 |
+
if (event.keyCode === ESC_KEY_CODE) {
|
163 |
this.overlay.clear();
|
164 |
}
|
165 |
}
|