mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-26 14:34:27 +02:00
First version zoom
This commit is contained in:
@@ -19,7 +19,8 @@ const PLUGINS = {
|
||||
'scroll': Plugins.Scroll,
|
||||
'touch': Plugins.Touch,
|
||||
'video': Plugins.Video,
|
||||
'youtube': Plugins.YouTube
|
||||
'youtube': Plugins.YouTube,
|
||||
'zoom': Plugins.Zoom
|
||||
};
|
||||
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import Scroll from './scroll';
|
||||
import Touch from './touch';
|
||||
import Video from './video';
|
||||
import YouTube from './youtube';
|
||||
import Zoom from './zoom';
|
||||
|
||||
export default {
|
||||
AutoSlide,
|
||||
@@ -19,5 +20,6 @@ export default {
|
||||
Scroll,
|
||||
Touch,
|
||||
Video,
|
||||
YouTube
|
||||
YouTube,
|
||||
Zoom
|
||||
};
|
||||
|
@@ -165,4 +165,27 @@ export default class DOM {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the integer value of a style property
|
||||
* @param {string} prop CSS property value
|
||||
* @return {integer} The property without the units
|
||||
*/
|
||||
static parseSize(prop) {
|
||||
return Number( prop.replace( /[^\d\.]/g, '' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps a HTML structure arrond a element
|
||||
* @param {Element} elem the element to be wrapped
|
||||
* @param {string} tag the new element tag
|
||||
* @return {Element} the new element
|
||||
*/
|
||||
static wrap(elem, tag) {
|
||||
const wrap = document.createElement(tag);
|
||||
elem.parentElement.insertBefore(wrap, elem);
|
||||
wrap.appendChild(elem);
|
||||
|
||||
return wrap;
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,9 @@ const Keys = {
|
||||
LEFT: 37,
|
||||
UP: 38,
|
||||
RIGHT: 39,
|
||||
DOWN: 40
|
||||
DOWN: 40,
|
||||
PLUS: [107, 171],
|
||||
MINUS: [109, 173]
|
||||
};
|
||||
|
||||
export default Keys;
|
||||
|
Reference in New Issue
Block a user