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

angular-fullpage.js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-fullpage.js - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

sample/vendor/angular-ui-router/.bower.json

2

package.json
{
"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 () {

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