fix tests

This commit is contained in:
Radu Woinaroski
2016-06-04 18:52:02 +02:00
parent f0f507bdc7
commit 3e104123c7
2 changed files with 64 additions and 19 deletions

View File

@@ -9,7 +9,8 @@ class SimpleTest {
this.element.mCustomScrollbar({
scrollButtons: {
enable: true
enable: true,
scrollAmount: 2
}
});
}
@@ -22,38 +23,78 @@ class SimpleTestAllParams {
this.element = $(".content");
this.element.mCustomScrollbar({
setWidth: false,
setHeight: false,
setWidth: 22,
setHeight: "40%",
setTop: 0,
setLeft: 22,
axis: "y",
scrollbarPosition: "inside",
scrollInertia: 950,
mouseWheel: true,
mouseWheelPixels: "auto",
autoDraggerLength: true,
autoHideScrollbar: false,
autoExpandScrollbar: false,
alwaysShowScrollbar: 0,
snapAmount: [3,3],
snapOffset: 3,
mouseWheel: {
enable: true,
scrollAmount: 1,
axis:"x",
preventDefault: false,
deltaFactor:12,
normalizeDelta:true,
invert: false,
disableOver: ["select","option"]
},
scrollButtons: {
enable: false,
scrollType: "continuous",
scrollSpeed: "auto",
scrollAmount: 40
scrollType: "stepped",
scrollAmount: 40,
tabindex: 33,
},
keyboard:{
enable: true,
scrollAmount:5,
scrollType:"stepless"
},
advanced: {
updateOnBrowserResize: true,
updateOnContentResize: false,
updateOnImageLoad: true,
updateOnSelectorChange: "ul li",
extraDraggableSelectors: ".myClass",
releaseDraggableSelectors: ".myClass",
autoUpdateTimeout:60,
autoExpandHorizontalScroll: false,
autoScrollOnFocus: true,
normalizeMouseWheelDelta: false
autoScrollOnFocus: "input",
},
contentTouchScroll: true,
documentTouchScroll: false,
callbacks: {
onCreate: () => { },
onInit: () => { },
onScrollStart: () => { },
onScroll: () => { },
onTotalScroll: () => { },
onTotalScrollBack: () => { },
onTotalScrollOffset: 0,
onTotalScrollBackOffset: 0,
whileScrolling: () => { }
whileScrolling: () => { },
alwaysTriggerOffsets: false,
onOverflowY: () => { },
onOverflowX: () => { },
onOverflowYNone: () => {},
onOverflowXNone: () => {},
onBeforeUpdate: () => {},
onUpdate: () => {},
onImageLoad: () => {},
onSelectorChange: () => {},
},
theme: "light"
theme: "light",
live: true,
liveSelector: ".myClass"
});
}
}

View File

@@ -10,11 +10,11 @@ declare namespace MCustomScrollbar {
/**
* Set the width of your content (overwrites CSS width), value in pixels (integer) or percentage (string)
*/
setWidth?: number|string;
setWidth?: boolean|number|string;
/**
* Set the height of your content (overwirtes CSS height), value in pixels (integer) or percentage (string)
*/
setHeight?: number|string;
setHeight?: boolean|number|string;
/**
* Set the initial css top property of content, accepts string values (css top position).
* Example: setTop: "-100px".
@@ -38,7 +38,7 @@ declare namespace MCustomScrollbar {
* Note that setting the value to "outside" requires your element (or parent elements)
* to have CSS position: relative (otherwise the scrollbar will be positioned in relation to documents root element).
*/
scrollbarPosition: "inside"|"outside";
scrollbarPosition?: "inside"|"outside";
/**
* Always keep scrollbar(s) visible, even when theres nothing to scroll.
* 0 disable (default)
@@ -52,7 +52,7 @@ declare namespace MCustomScrollbar {
* Note that your elements must be of equal width or height in order for this to work properly.
* To set different values for vertical and horizontal scrolling, use an array: [y,x]
*/
snapAmount?: number;
snapAmount?: number|[number,number];
/**
* Set an offset (in pixels) for the snapAmount option. Useful when for example you need to offset the
* snap amount of table rows by the table header.
@@ -112,7 +112,7 @@ declare namespace MCustomScrollbar {
/**
* Keyboard support
*/
keyboard:{
keyboard?:{
/**
* Enable or disable content scrolling via keyboard.
*/
@@ -155,7 +155,7 @@ declare namespace MCustomScrollbar {
/**
* Set a tabindex value for the buttons.
*/
tabIndex?: number;
tabindex?: number;
/**
* Scroll buttons pixels scrolling amount, value in pixels or "auto"
*/
@@ -225,6 +225,10 @@ declare namespace MCustomScrollbar {
* Integer values define the axis-specific minimum amount required for scrolling momentum (default: 25).
*/
contentTouchScroll?: boolean|number;
/**
* Enable or disable document touch-swipe scrolling for touch-enabled devices.
*/
documentTouchScroll?: boolean;
/**
* All of the following callbacks option have examples in the callback demo - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/callbacks_example.html
*/
@@ -304,7 +308,7 @@ declare namespace MCustomScrollbar {
/**
* A function to call each time a type of element is added, removed or changes its size and scrollbar(s) are updated.
*/
onSelctorChange?: () => void;
onSelectorChange?: () => void;
}
/**
* Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html