UNPKG

ngx-fullpage

Version:
211 lines 8.83 kB
/** * @author Meiblorn (Vadim Fedorenko) <meiblorn@gmail.com | admin@meiblorn.com> on 11/05/16. */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { Injectable } from '@angular/core'; var MnFullpageResponsiveSlides = /** @class */ (function () { function MnFullpageResponsiveSlides() { } // noinspection JSMethodCanBeStatic /** * Extension of fullpage.js. Requires fullpage.js >= 2.8.5. * Turns horizontal slides into vertical sections. */ MnFullpageResponsiveSlides.prototype.toSections = function () { $.fn.fullpage.responsiveSlides.toSections(); }; // noinspection JSMethodCanBeStatic /** * Extension of fullpage.js. Requires fullpage.js >= 2.8.5. * Turns back the original slides (now converted into * vertical sections) into horizontal slides again. */ MnFullpageResponsiveSlides.prototype.toSlides = function () { $.fn.fullpage.responsiveSlides.toSlides(); }; MnFullpageResponsiveSlides = __decorate([ Injectable() ], MnFullpageResponsiveSlides); return MnFullpageResponsiveSlides; }()); export { MnFullpageResponsiveSlides }; var MnFullpageService = /** @class */ (function () { function MnFullpageService(responsiveSlides) { this.responsiveSlides = responsiveSlides; } // noinspection JSMethodCanBeStatic /** * Scrolls one section up */ MnFullpageService.prototype.moveSectionUp = function () { $.fn.fullpage.moveSectionUp(); }; // noinspection JSMethodCanBeStatic /** * Scrolls one section down */ MnFullpageService.prototype.moveSectionDown = function () { $.fn.fullpage.moveSectionDown(); }; //noinspection JSMethodCanBeStatic /** * @description Scrolls the page to the given section and slide. * The first slide, the visible one by default, will have index 0. */ MnFullpageService.prototype.moveTo = function (section, slide) { $.fn.fullpage.moveTo(section, slide); }; //noinspection JSMethodCanBeStatic /** * Exactly the same as moveTo but in this case it performs the scroll without animation. * A direct jump to the destination. */ MnFullpageService.prototype.silentMoveTo = function (section, slide) { $.fn.fullpage.silentMoveTo(section, slide); }; //noinspection JSMethodCanBeStatic /** * Scrolls the horizontal slider of the current section to the next slide */ MnFullpageService.prototype.moveSlideRight = function () { $.fn.fullpage.moveSlideRight(); }; //noinspection JSMethodCanBeStatic /** * Scrolls the horizontal slider of the current section to the previous slide */ MnFullpageService.prototype.moveSlideLeft = function () { $.fn.fullpage.moveSlideLeft(); }; //noinspection JSMethodCanBeStatic /** * Sets the scrolling configuration in real time. * Defines the way the page scrolling behaves. If it is set to true, * it will use the "automatic" scrolling, otherwise, it will use the "manual" * or "normal" scrolling of the site. Be careful when combining this option with * scrollOverflow set to true, as it might be difficult to scroll using the mouse * wheel or the trackpad when the section is scrollable */ MnFullpageService.prototype.setAutoScrolling = function (enable) { $.fn.fullpage.setAutoScrolling(enable); }; //noinspection JSMethodCanBeStatic /** * Sets the value for the option fitToSection determining whether to fit * the section in the screen or not. */ MnFullpageService.prototype.setFitToSection = function (enable) { $.fn.fullpage.setFitToSection(enable); }; //noinspection JSMethodCanBeStatic /** * Sets the value for the option lockAnchors determining whether * anchors will have any effect in the URL or not. */ MnFullpageService.prototype.setLockAnchors = function (enable) { $.fn.fullpage.setLockAnchors(enable); }; //noinspection JSMethodCanBeStatic /** * Adds or remove the possibility of scrolling through sections by * using the mouse wheel/trackpad or touch gestures (which is active * by default). Note this won't disable the keyboard scrolling. * You would need to use setKeyboardScrolling for it. * * Directions: (optional parameter) Admitted values: all, up, down, * left, right or a combination of them separated by commas like down, * right. It defines the direction for which the scrolling will * be enabled or disabled. */ MnFullpageService.prototype.setAllowScrolling = function (allow, directions) { $.fn.fullpage.setAllowScrolling(allow, directions); }; //noinspection JSMethodCanBeStatic /** * Adds or remove the possibility of scrolling through sections by * using the keyboard arrow keys (which is active by default). * * Directions: (optional parameter) Admitted values: all, up, down, * left, right or a combination of them separated by commas like down, * right. It defines the direction for which the scrolling will be * enabled or disabled. */ MnFullpageService.prototype.setKeyboardScrolling = function (allow, directions) { $.fn.fullpage.setKeyboardScrolling(allow, directions); }; //noinspection JSMethodCanBeStatic /** * Defines whether to record the history for each hash change in the URL */ MnFullpageService.prototype.setRecordHistory = function (enable) { $.fn.fullpage.setRecordHistory(enable); }; //noinspection JSMethodCanBeStatic /** * Defines the scrolling speed in milliseconds */ MnFullpageService.prototype.setScrollingSpeed = function (milliseconds) { $.fn.fullpage.setScrollingSpeed(milliseconds); }; //noinspection JSMethodCanBeStatic /** * Destroys the plugin events and optionally its HTML markup and styles. * Ideal to use when using AJAX to load content. * * type: can be empty or all. If all is passed, the HTML markup and styles * used by fullpage.js will be removed. This way the original HTML markup, * the one used before any plugin modification is made, will be maintained. */ MnFullpageService.prototype.destroy = function (type) { $.fn.fullpage.destroy(type); }; //noinspection JSMethodCanBeStatic /** * Updates the DOM structure to fit the new window size or its contents. * Ideal to use in combination with AJAX calls or external changes in the * DOM structure of the site. */ MnFullpageService.prototype.reBuild = function () { $.fn.fullpage.reBuild(); }; // noinspection JSMethodCanBeStatic /** * Determines whether or not to fit sections to the viewport or not. * When set to true the current active section will always fill the whole viewport. * Otherwise the user will be free to stop in the middle of a section. */ MnFullpageService.prototype.fitToSection = function () { $.fn.fullpage.fitToSection(); }; // noinspection JSMethodCanBeStatic /** * Adds or remove the possibility of scrolling through sections * by using the mouse wheel or the trackpad. */ MnFullpageService.prototype.setMouseWheelScrolling = function (active) { $.fn.fullpage.setMouseWheelScrolling(active); }; // noinspection JSMethodCanBeStatic /** * Sets the responsive mode of the page. When set to true the autoScrolling will be turned off and the result * will be exactly the same one as when the responsiveWidth or responsiveHeight options get fired. */ MnFullpageService.prototype.setResponsive = function (active) { $.fn.fullpage.setResponsive(active); }; MnFullpageService = __decorate([ Injectable(), __metadata("design:paramtypes", [MnFullpageResponsiveSlides]) ], MnFullpageService); return MnFullpageService; }()); export { MnFullpageService }; //# sourceMappingURL=mnFullpage.service.js.map