1
0
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:
Luis
2017-03-31 18:15:35 +02:00
parent 66d80f0b5d
commit 0768afe146
4 changed files with 31 additions and 3 deletions

View File

@@ -19,7 +19,8 @@ const PLUGINS = {
'scroll': Plugins.Scroll,
'touch': Plugins.Touch,
'video': Plugins.Video,
'youtube': Plugins.YouTube
'youtube': Plugins.YouTube,
'zoom': Plugins.Zoom
};

View File

@@ -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
};

View File

@@ -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;
}
}

View File

@@ -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;