nativescript-slides
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -19,2 +19,3 @@ "use strict"; | ||
var SLIDE_INDICATOR_ACTIVE = 'slide-indicator-active'; | ||
var SLIDE_INDICATOR_WRAP = 'slide-indicator-wrap'; | ||
var LayoutParams; | ||
@@ -77,3 +78,3 @@ if (app.android) { | ||
get: function () { | ||
return !!this.currentPanel.right; | ||
return !!this.currentPanel && !!this.currentPanel.right; | ||
}, | ||
@@ -85,3 +86,3 @@ enumerable: true, | ||
get: function () { | ||
return !!this.currentPanel.left; | ||
return !!this.currentPanel && !!this.currentPanel.left; | ||
}, | ||
@@ -172,2 +173,3 @@ enumerable: true, | ||
this.on(absolute_layout_1.AbsoluteLayout.loadedEvent, function (data) { | ||
console.log('LOADDED EVENT'); | ||
if (!_this._loaded) { | ||
@@ -194,29 +196,31 @@ _this._loaded = true; | ||
_this.currentPanel = _this.buildSlideMap(slides_1); | ||
_this.positionPanels(_this.currentPanel); | ||
if (_this.disablePan === false) { | ||
_this.applySwipe(_this.pageWidth); | ||
if (_this.currentPanel) { | ||
_this.positionPanels(_this.currentPanel); | ||
if (_this.disablePan === false) { | ||
_this.applySwipe(_this.pageWidth); | ||
} | ||
if (app.ios) { | ||
_this.ios.clipsToBound = true; | ||
} | ||
app.on(app.orientationChangedEvent, function (args) { | ||
setTimeout(function () { | ||
console.log('orientationChangedEvent'); | ||
_this.width = parseInt(_this.slideWidth); | ||
_this.eachLayoutChild(function (view) { | ||
if (view instanceof stack_layout_1.StackLayout) { | ||
absolute_layout_1.AbsoluteLayout.setLeft(view, _this.pageWidth); | ||
view.width = _this.pageWidth; | ||
} | ||
}); | ||
if (_this.disablePan === false) { | ||
_this.applySwipe(_this.pageWidth); | ||
} | ||
var topOffset = Platform.screen.mainScreen.heightDIPs - 105; | ||
if (_this.pageIndicators) { | ||
_this._footer.marginTop = '88%'; | ||
} | ||
_this.positionPanels(_this.currentPanel); | ||
}, 0); | ||
}); | ||
} | ||
if (app.ios) { | ||
_this.ios.clipsToBound = true; | ||
} | ||
app.on(app.orientationChangedEvent, function (args) { | ||
setTimeout(function () { | ||
console.log('orientationChangedEvent'); | ||
_this.width = parseInt(_this.slideWidth); | ||
_this.eachLayoutChild(function (view) { | ||
if (view instanceof stack_layout_1.StackLayout) { | ||
absolute_layout_1.AbsoluteLayout.setLeft(view, _this.pageWidth); | ||
view.width = _this.pageWidth; | ||
} | ||
}); | ||
if (_this.disablePan === false) { | ||
_this.applySwipe(_this.pageWidth); | ||
} | ||
var topOffset = Platform.screen.mainScreen.heightDIPs - 105; | ||
if (_this.pageIndicators) { | ||
_this._footer.marginTop = '88%'; | ||
} | ||
_this.positionPanels(_this.currentPanel); | ||
}, 0); | ||
}); | ||
} | ||
@@ -278,3 +282,3 @@ }); | ||
SlideContainer.prototype.goToSlide = function (index) { | ||
if (this._slideMap.length > 0 && index < this._slideMap.length) { | ||
if (this._slideMap && this._slideMap.length > 0 && index < this._slideMap.length) { | ||
var previousSlide = this.currentPanel; | ||
@@ -447,6 +451,4 @@ this.setupPanel(this._slideMap[index]); | ||
footerInnerWrap.clipToBounds = false; | ||
footerInnerWrap.className = SLIDE_INDICATOR_WRAP; | ||
absolute_layout_1.AbsoluteLayout.setTop(footerInnerWrap, 0); | ||
footerInnerWrap.orientation = 'horizontal'; | ||
footerInnerWrap.verticalAlignment = 'top'; | ||
footerInnerWrap.horizontalAlignment = 'center'; | ||
footerInnerWrap.width = this.pageWidth / 2; | ||
@@ -453,0 +455,0 @@ var index = 0; |
@@ -21,3 +21,3 @@ require("nativescript-dom"); | ||
const SLIDE_INDICATOR_ACTIVE = 'slide-indicator-active'; | ||
const SLIDE_INDICATOR_WRAP = 'slide-indicator-wrap'; | ||
let LayoutParams: any; | ||
@@ -87,6 +87,6 @@ if (app.android) { | ||
get hasNext(): boolean { | ||
return !!this.currentPanel.right; | ||
return !!this.currentPanel && !!this.currentPanel.right; | ||
} | ||
get hasPrevious(): boolean { | ||
return !!this.currentPanel.left; | ||
return !!this.currentPanel && !!this.currentPanel.left; | ||
} | ||
@@ -175,2 +175,3 @@ | ||
this.on(AbsoluteLayout.loadedEvent, (data: any) => { | ||
console.log('LOADDED EVENT'); | ||
if (!this._loaded) { | ||
@@ -201,33 +202,36 @@ this._loaded = true; | ||
this.currentPanel = this.buildSlideMap(slides); | ||
this.positionPanels(this.currentPanel); | ||
if (this.currentPanel) { | ||
if (this.disablePan === false) { | ||
this.applySwipe(this.pageWidth); | ||
this.positionPanels(this.currentPanel); | ||
if (this.disablePan === false) { | ||
this.applySwipe(this.pageWidth); | ||
} | ||
if (app.ios) { | ||
this.ios.clipsToBound = true; | ||
} | ||
//handles application orientation change | ||
app.on(app.orientationChangedEvent, (args: app.OrientationChangedEventData) => { | ||
//event and page orientation didn't seem to alwasy be on the same page so setting it in the time out addresses this. | ||
setTimeout(() => { | ||
console.log('orientationChangedEvent'); | ||
this.width = parseInt(this.slideWidth); | ||
this.eachLayoutChild((view: View) => { | ||
if (view instanceof StackLayout) { | ||
AbsoluteLayout.setLeft(view, this.pageWidth); | ||
view.width = this.pageWidth; | ||
} | ||
}); | ||
if (this.disablePan === false) { | ||
this.applySwipe(this.pageWidth); | ||
} | ||
let topOffset = Platform.screen.mainScreen.heightDIPs - 105; | ||
if (this.pageIndicators) { | ||
this._footer.marginTop = <any>'88%'; | ||
} | ||
this.positionPanels(this.currentPanel); | ||
}, 0); | ||
}); | ||
} | ||
if (app.ios) { | ||
this.ios.clipsToBound = true; | ||
} | ||
//handles application orientation change | ||
app.on(app.orientationChangedEvent, (args: app.OrientationChangedEventData) => { | ||
//event and page orientation didn't seem to alwasy be on the same page so setting it in the time out addresses this. | ||
setTimeout(() => { | ||
console.log('orientationChangedEvent'); | ||
this.width = parseInt(this.slideWidth); | ||
this.eachLayoutChild((view: View) => { | ||
if (view instanceof StackLayout) { | ||
AbsoluteLayout.setLeft(view, this.pageWidth); | ||
view.width = this.pageWidth; | ||
} | ||
}); | ||
if (this.disablePan === false) { | ||
this.applySwipe(this.pageWidth); | ||
} | ||
let topOffset = Platform.screen.mainScreen.heightDIPs - 105; | ||
if (this.pageIndicators) { | ||
this._footer.marginTop = <any>'88%'; | ||
} | ||
this.positionPanels(this.currentPanel); | ||
}, 0); | ||
}); | ||
} | ||
@@ -297,3 +301,3 @@ }); | ||
public goToSlide(index: number): void { | ||
if (this._slideMap.length > 0 && index < this._slideMap.length) { | ||
if (this._slideMap && this._slideMap.length > 0 && index < this._slideMap.length) { | ||
let previousSlide = this.currentPanel; | ||
@@ -492,10 +496,8 @@ | ||
footerInnerWrap.clipToBounds = false; | ||
footerInnerWrap.className = SLIDE_INDICATOR_WRAP; | ||
AbsoluteLayout.setTop(footerInnerWrap, 0); | ||
footerInnerWrap.orientation = 'horizontal'; | ||
footerInnerWrap.verticalAlignment = 'top'; | ||
footerInnerWrap.horizontalAlignment = 'center'; | ||
footerInnerWrap.width = this.pageWidth / 2; | ||
@@ -502,0 +504,0 @@ |
{ | ||
"name": "nativescript-slides", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "NativeScript Slides plugin.", | ||
@@ -5,0 +5,0 @@ "main": "nativescript-slides.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 37 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
2
297192
18
1305