Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bw-vm

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bw-vm - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

97

index.js

@@ -103,2 +103,4 @@ function ViewManager( settings ) {

var oldContent = this.cContent;
var onOldOut;
var onNewIn = function() {

@@ -114,42 +116,21 @@

};
var onOldOut;
// resize the newContent if it has a resize method
if( newContent.resize ) {
newContent.resize( s.width, s.height );
}
var bringInNewContent = function() {
// call a callback that we're starting to animatein content
if( s.onStartAniIn ) {
s.onStartAniIn( newContent, this.cContent );
}
if( s.onStartAniIn ) {
s.onStartAniIn( newContent, this.cContent );
}
// check if there's content on screen already
if( this.cContent ) {
this.cContent = newContent;
this.nContent = null;
// setup the old out function
onOldOut = function() {
if( newContent.animateIn ) {
newContent.animateIn( this.data, onNewIn );
} else {
onNewIn();
}
}.bind( this );
if( s.onEndAniOut ) {
s.onEndAniOut( newContent, oldContent );
}
var takeOutOldContent = function() {
if( oldContent.destroy ) {
oldContent.destroy( this.data, function() { } );
}
if( !s.overlap ) {
if( newContent.animateIn ) {
newContent.animateIn( this.data, onNewIn );
} else {
onNewIn();
}
}
}.bind(this);
// call a callback that we're starting to animateout content
if( s.onStartAniOut ) {

@@ -159,2 +140,3 @@ s.onStartAniOut( newContent, oldContent );

// if there's an animateOut function execute it on oldContent
if( oldContent.animateOut ) {

@@ -165,22 +147,47 @@ oldContent.animateOut( this.data, onOldOut );

}
}.bind( this );
if( s.overlap ) {
var destroyOldContent = function() {
if( newContent.animateIn ) {
newContent.animateIn( this.data, onNewIn );
} else {
onNewIn();
}
if( s.onEndAniOut ) {
s.onEndAniOut( newContent, oldContent );
}
} else {
this.cContent = newContent;
this.nContent = null;
if( oldContent.destroy ) {
oldContent.destroy( this.data, function() { } );
}
}.bind( this );
// just bring new content
if( newContent.animateIn ) {
newContent.animateIn( this.data, onNewIn );
// resize the newContent if it has a resize method
if( newContent.resize ) {
newContent.resize( s.width, s.height );
}
// check if there's content on screen already
if( this.cContent ) {
if( s.overlap ) {
onOldOut = destroyOldContent;
} else {
onNewIn();
onOldOut = function() {
destroyOldContent();
bringInNewContent();
}.bind(this);
}
// call the callback to notify that we've started animating out
takeOutOldContent();
if( s.overlap ) {
bringInNewContent();
}
// else we don't have current content just bring in the new
} else {
bringInNewContent();
}

@@ -187,0 +194,0 @@ }

{
"name": "bw-vm",
"version": "2.0.1",
"version": "2.0.2",
"description": "This is a view manager for bigwheel (it brings in out content)",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc