nativescript-slides
Advanced tools
Comparing version 2.2.9 to 2.2.10
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -59,2 +49,4 @@ require("nativescript-dom"); | ||
_this.setupDefaultValues(); | ||
// if being used in an ng2 app we want to prevent it from excuting the constructView | ||
// until it is called manually in ngAfterViewInit. | ||
_this.constructView(true); | ||
@@ -64,2 +56,3 @@ return _this; | ||
Object.defineProperty(SlideContainer.prototype, "pageIndicators", { | ||
/* page indicator stuff*/ | ||
get: function () { | ||
@@ -69,2 +62,5 @@ return this._pageIndicators; | ||
set: function (value) { | ||
if (typeof value === 'string') { | ||
value = (value == 'true'); | ||
} | ||
this._pageIndicators = value; | ||
@@ -173,3 +169,3 @@ }, | ||
if (this._pagerOffset == null) { | ||
this._pagerOffset = '88%'; | ||
this._pagerOffset = '88%'; //defaults to white. | ||
} | ||
@@ -181,3 +177,3 @@ }; | ||
this.on(absolute_layout_1.AbsoluteLayout.loadedEvent, function (data) { | ||
console.log('LOADDED EVENT'); | ||
//// console.log('LOADDED EVENT'); | ||
if (!_this._loaded) { | ||
@@ -189,3 +185,6 @@ _this._loaded = true; | ||
var slides_1 = []; | ||
_this.width = parseInt(_this.slideWidth); | ||
if (!_this.slideWidth) { | ||
_this.slideWidth = _this.pageWidth; | ||
} | ||
_this.width = +(_this.slideWidth); | ||
_this.eachLayoutChild(function (view) { | ||
@@ -195,3 +194,3 @@ if (view instanceof stack_layout_1.StackLayout) { | ||
view.width = _this.pageWidth; | ||
view.height = '100%'; | ||
view.height = '100%'; //get around compiler | ||
slides_1.push(view); | ||
@@ -214,5 +213,7 @@ } | ||
} | ||
//handles application orientation change | ||
app.on(app.orientationChangedEvent, function (args) { | ||
//event and page orientation didn't seem to alwasy be on the same page so setting it in the time out addresses this. | ||
setTimeout(function () { | ||
console.log('orientationChangedEvent'); | ||
// console.log('orientationChangedEvent'); | ||
_this.width = parseInt(_this.slideWidth); | ||
@@ -275,2 +276,3 @@ _this.eachLayoutChild(function (view) { | ||
this.currentPanel = panel; | ||
// sets up each panel so that they are positioned to transition either way. | ||
this.positionPanels(this.currentPanel); | ||
@@ -285,2 +287,3 @@ if (this.disablePan === false) { | ||
SlideContainer.prototype.positionPanels = function (panel) { | ||
// sets up each panel so that they are positioned to transition either way. | ||
if (panel.left != null) { | ||
@@ -309,3 +312,3 @@ panel.left.panel.translateX = -this.pageWidth * 2; | ||
else { | ||
console.log('invalid index'); | ||
// console.log('invalid index'); | ||
} | ||
@@ -315,3 +318,3 @@ }; | ||
var _this = this; | ||
var previousDelta = -1; | ||
var previousDelta = -1; //hack to get around ios firing pan event after release | ||
var endingVelocity = 0; | ||
@@ -328,2 +331,4 @@ var startTime, deltaTime; | ||
deltaTime = Date.now() - startTime; | ||
// if velocityScrolling is enabled then calculate the velocitty | ||
// swiping left to right. | ||
if (args.deltaX > (pageWidth / 3)) { | ||
@@ -338,2 +343,4 @@ if (_this.hasPrevious) { | ||
else { | ||
//We're at the start | ||
//Notify no more slides | ||
_this.triggerCancelEvent(cancellationReason.noPrevSlides); | ||
@@ -348,4 +355,6 @@ } | ||
_this.setupPanel(_this.currentPanel.right); | ||
// Notify changed | ||
_this.triggerChangeEventRightToLeft(); | ||
if (!_this.hasNext) { | ||
// Notify finsihed | ||
_this.notify({ | ||
@@ -359,2 +368,4 @@ eventName: SlideContainer.finishedEvent, | ||
else { | ||
// We're at the end | ||
// Notify no more slides | ||
_this.triggerCancelEvent(cancellationReason.noMoreSlides); | ||
@@ -365,2 +376,3 @@ } | ||
if (_this.transitioning === false) { | ||
//Notify cancelled | ||
_this.triggerCancelEvent(cancellationReason.user); | ||
@@ -427,3 +439,3 @@ _this.transitioning = true; | ||
var animationDuration; | ||
animationDuration = 300; | ||
animationDuration = 300; // default value | ||
var transition = new Array(); | ||
@@ -449,3 +461,3 @@ transition.push({ | ||
var animationDuration; | ||
animationDuration = 300; | ||
animationDuration = 300; // default value | ||
var transition = new Array(); | ||
@@ -471,2 +483,3 @@ transition.push({ | ||
var footerInnerWrap = new stack_layout_1.StackLayout(); | ||
//footerInnerWrap.height = 50; | ||
footerInnerWrap.clipToBounds = false; | ||
@@ -579,5 +592,7 @@ footerInnerWrap.className = SLIDE_INDICATOR_WRAP; | ||
if (typeof theProperty === "function") { | ||
// xCode 7 and below | ||
return theProperty.call(theClass); | ||
} | ||
else { | ||
// xCode 8+ | ||
return theProperty; | ||
@@ -593,2 +608,1 @@ } | ||
exports.SlideContainer = SlideContainer; | ||
//# sourceMappingURL=nativescript-slides.js.map |
@@ -75,2 +75,5 @@ require("nativescript-dom"); | ||
set pageIndicators(value: boolean) { | ||
if (typeof value === 'string') { | ||
value = (<any>value == 'true'); | ||
} | ||
this._pageIndicators = value; | ||
@@ -174,3 +177,3 @@ } | ||
this.on(AbsoluteLayout.loadedEvent, (data: any) => { | ||
console.log('LOADDED EVENT'); | ||
//// console.log('LOADDED EVENT'); | ||
if (!this._loaded) { | ||
@@ -219,3 +222,3 @@ this._loaded = true; | ||
setTimeout(() => { | ||
console.log('orientationChangedEvent'); | ||
// console.log('orientationChangedEvent'); | ||
this.width = parseInt(this.slideWidth); | ||
@@ -323,3 +326,3 @@ this.eachLayoutChild((view: View) => { | ||
} else { | ||
console.log('invalid index'); | ||
// console.log('invalid index'); | ||
} | ||
@@ -326,0 +329,0 @@ } |
{ | ||
"name": "nativescript-slides", | ||
"version": "2.2.9", | ||
"version": "2.2.10", | ||
"description": "NativeScript Slides plugin.", | ||
"main": "nativescript-slides.js", | ||
"nativescript": { | ||
"platforms": { | ||
"android": "2.3.0", | ||
"ios": "2.3.0" | ||
}, | ||
"tns-ios": { | ||
"version": "2.3.0" | ||
} | ||
}, | ||
"main": "nativescript-slides", | ||
"scripts": { | ||
"build": "tsc", | ||
"demo.ios": "npm run preparedemo && cd demo && tns emulate ios", | ||
"demo.ios": "npm run preparedemo && cd demo && tns run ios", | ||
"demo.android": "npm run preparedemo && cd demo && tns run android", | ||
"preparedemo": "npm run build && cd demo && tns plugin remove nativescript-slides && tns plugin add .. && tns install", | ||
"preparedemo": "npm run build && cd demo && npm install .. --save", | ||
"setup": "npm install && cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd ..", | ||
@@ -73,9 +64,9 @@ "ios": "xcproj --project platforms/ios/YourApp.xcodeproj touch; xcproj --project platforms/ios/Pods/Pods.xcodeproj touch; tns livesync ios --emulator --watch" | ||
"devDependencies": { | ||
"typescript": "^1.8.7", | ||
"tns-platform-declarations": "^2.0.0", | ||
"tns-core-modules": "^2.3.0" | ||
"typescript": "^2.2.2", | ||
"tns-platform-declarations": "^3.0.1", | ||
"tns-core-modules": "^3.0.1" | ||
}, | ||
"dependencies": { | ||
"nativescript-dom": "^1.0.6" | ||
"nativescript-dom": "^2.0.0" | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"module": "commonjs", | ||
"removeComments": true, | ||
"experimentalDecorators": true, | ||
"sourceMap": true, | ||
"declaration": true | ||
"emitDecoratorMetadata": true, | ||
"noEmitHelpers": true, | ||
"noEmitOnError": true, | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"baseUrl": ".", | ||
"paths": { | ||
"*": [ | ||
"./node_modules/tns-core-modules/*", | ||
"./node_modules/*" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"nativescript-slides.ts" | ||
], | ||
"compileOnSave": false | ||
"exclude": [ | ||
"node_modules", | ||
"demo", | ||
"**/*.aot.ts" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
74382
13
1355
+ Addednativescript-dom@2.0.5(transitive)
- Removednativescript-dom@1.1.0(transitive)
Updatednativescript-dom@^2.0.0