angular-fullpage.js
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "angular-fullpage.js", | ||
"description": "A simple angular directive for fullPage.js", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "angular-fullpage.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -8,5 +8,5 @@ ;(function() { | ||
fullPage.$inject = ['$timeout', '$window']; | ||
fullPage.$inject = ['$timeout']; | ||
function fullPage($timeout, $window) { | ||
function fullPage($timeout) { | ||
var directive = { | ||
@@ -20,14 +20,16 @@ restrict: 'A', | ||
function link(scope, element, attrs) { | ||
var initialized = false; | ||
function link(scope, element) { | ||
var pageIndex; | ||
var slideIndex; | ||
var afterRender; | ||
var rebuild = function() { | ||
destroyFullPage(); | ||
console.log('rebuilt'); | ||
angular.element(element).fullpage(sanatizeOptions(scope.options)); | ||
angular.element(element).fullpage(sanatizeOptions(scope.options)); | ||
if (typeof afterRender === 'function') { | ||
afterRender(); | ||
} | ||
}; | ||
@@ -42,12 +44,24 @@ | ||
var sanatizeOptions = function(options) { | ||
options.onLeave = function(page, next){ | ||
pageIndex = next; | ||
}; | ||
var onLeave; | ||
var onSlideLeave; | ||
options.onSlideLeave = function(anchorLink, page, slide, direction, next){ | ||
pageIndex = page; | ||
slideIndex = next; | ||
}; | ||
if (typeof options === 'object') { | ||
if (options.afterRender) { | ||
afterRender = options.afterRender; | ||
} | ||
options.afterRender = function(){ | ||
if (options.onLeave) { | ||
onLeave = options.onLeave; | ||
} | ||
if (options.onSlideLeave) { | ||
onSlideLeave = options.onSlideLeave; | ||
} | ||
} | ||
options.afterRender = afterAngularRender; | ||
options.onLeave = onAngularLeave; | ||
options.onSlideLeave = onAngularSlideLeave; | ||
function afterAngularRender() { | ||
//We want to remove the HREF targets for navigation because they use hashbang | ||
@@ -64,4 +78,23 @@ //They still work without the hash though, so its all good. | ||
} | ||
}; | ||
} | ||
function onAngularLeave(page, next){ | ||
pageIndex = next; | ||
if (typeof onLeave === 'function') { | ||
onLeave(); | ||
} | ||
} | ||
function onAngularSlideLeave(anchorLink, page, slide, direction, next) { | ||
pageIndex = page; | ||
slideIndex = next; | ||
if (typeof onSlideLeave === 'function') { | ||
onSlideLeave(); | ||
} | ||
} | ||
//options.afterRender = afterAngularRender; | ||
//if we are using a ui-router, we need to be able to handle anchor clicks without 'href="#thing"' | ||
@@ -68,0 +101,0 @@ $(document).on('click', '[data-menuanchor]', function () { |
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 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
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
11880349
202
64072
1
2
1
6