phila-standards
Advanced tools
Comparing version 0.3.5 to 0.3.6
{ | ||
"name": "phila-standards", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "City of Philadelphia Standards", | ||
"main": "src/js/main.js", | ||
"style": "dist/css/phila-standards.css", | ||
"repository": "https://github.com/CityOfPhiladelphia/standards.git", | ||
@@ -11,3 +12,4 @@ "author": "City of Philadelphia", | ||
"font-awesome": "^4.7.0", | ||
"foundation-sites": "^6.3.1" | ||
"foundation-sites": "^6.3.1", | ||
"postscribe": "^2.0.8" | ||
}, | ||
@@ -35,11 +37,11 @@ "devDependencies": { | ||
"build:js": "browserify src/js/main.js | uglifyjs -mc > dist/js/phila-standards.min.js", | ||
"build": "yarn run setup && yarn run assets && yarn run build:css && yarn run build:js", | ||
"build": "yarn setup && yarn assets && yarn build:css && yarn build:js", | ||
"postbuild": "postcss --use autoprefixer -b 'last 2 versions' < dist/css/phila-standards.css -o dist/css/phila-standards.css", | ||
"watch:css": "yarn build:css && yarn build:css -- -w", | ||
"watch:js": "watchify src/js/main.js -o dist/js/phila-standards.js -v", | ||
"watch": "parallelshell 'yarn run watch:css' 'yarn run watch:js'", | ||
"start": "yarn run watch", | ||
"prerelease": "yarn run clean", | ||
"release": "yarn run build" | ||
"watch": "parallelshell 'yarn watch:css' 'yarn watch:js'", | ||
"start": "yarn watch", | ||
"prerelease": "yarn clean", | ||
"release": "yarn build" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
module.export = $(function(){ | ||
module.exports = $(function(){ | ||
if ( $('#back-to-top').length ) { | ||
@@ -12,3 +12,3 @@ var scrollTrigger = 100, // px | ||
}; | ||
backToTop(); | ||
@@ -15,0 +15,0 @@ |
@@ -1,4 +0,8 @@ | ||
module.export = $(function(){ | ||
var postscribe = require('postscribe'); | ||
module.exports = $(function(){ | ||
/* Async loaded feedback forms */ | ||
$.fn.feedbackify = function( src ) { | ||
postscribe('#form-container', '<script type="text/javascript" src="' + src + '"><\/script>'); | ||
@@ -5,0 +9,0 @@ $('html,body').animate({ |
@@ -1,2 +0,2 @@ | ||
module.export = $(function(){ | ||
module.exports = $(function(){ | ||
@@ -17,12 +17,2 @@ /*Globals */ | ||
$( $( '.global-nav a' ) ).each( function() { | ||
if ( currentPath == $( this ).attr('href') || currentPath == $( this ).data( 'link' ) ){ | ||
$(this).addClass('js-is-current'); | ||
//special handling for services | ||
}else if( currentPath.indexOf('/services/') === 0 ){ | ||
$('.services-menu-link a').addClass('js-is-current'); | ||
} | ||
}); | ||
/* Provide option for explict show/hide declarations, with jQuery fallbacks for older (ios) browsers */ | ||
@@ -70,3 +60,3 @@ function togglePageBody( show ){ | ||
$('.menu-icon .title-bar-title').text( ( $('.menu-icon .title-bar-title' ).text() == 'Menu' ) ? 'Close' : 'Menu' ); | ||
$('.menu-icon .title-bar-title').text( ( $('.menu-icon .title-bar-title' ).text() === 'Menu' ) ? 'Close' : 'Menu' ); | ||
@@ -148,4 +138,2 @@ $('.global-nav .menu-icon').toggleClass('active'); | ||
function resetLayout(){ | ||
togglePageBody( true ); | ||
$('.menu-icon i').addClass('fa-bars').removeClass('fa-close'); | ||
$('.menu-icon .title-bar-title').text('Menu'); | ||
@@ -156,7 +144,11 @@ $('.menu-icon').removeClass('active'); | ||
resetTopBar(); | ||
} | ||
function resetTopBar(){ | ||
$('body').removeClass('no-scroll'); | ||
$( '.site-search i' ).addClass('fa-search').removeClass('fa-close'); | ||
$('.menu-icon i').addClass('fa-bars').removeClass('fa-close'); | ||
if ( $('.is-drilldown').is(':visible') ) { | ||
$('.title-bar').foundation('toggleMenu'); | ||
} | ||
} | ||
@@ -166,20 +158,11 @@ | ||
function resetScroll(){ | ||
$('#page').click( function() { | ||
$('body').removeClass('no-scroll'); | ||
$( '.site-search i' ).addClass('fa-search').removeClass('fa-close'); | ||
$('#page, footer').click( function() { | ||
resetTopBar(); | ||
}); | ||
$('footer').click( function() { | ||
$('body').removeClass('no-scroll'); | ||
$( '.site-search i' ).addClass('fa-search').removeClass('fa-close'); | ||
}); | ||
$(document).keyup(function(e) { | ||
//on escape, also remove no-scroll | ||
if (e.keyCode == 27) { | ||
if (e.keyCode === 27) { | ||
$('body').removeClass('no-scroll'); | ||
if ( $('.is-drilldown').is(':visible') ) { | ||
$('.title-bar').foundation('toggleMenu'); | ||
togglePageBody(true); | ||
} | ||
menuToggle(); | ||
} | ||
@@ -189,2 +172,9 @@ }); | ||
function menuToggle(){ | ||
if ( $('.is-drilldown').is(':visible') ) { | ||
$('.title-bar').foundation('toggleMenu'); | ||
togglePageBody(true); | ||
} | ||
} | ||
function checkBrowserHeight( navHeight ){ | ||
@@ -251,12 +241,7 @@ if ( $('body').hasClass('logged-in') ) { | ||
$('.site-search-dropdown').on('show.zf.dropdown', function(){ | ||
if ( $('.is-drilldown').is(':visible') ) { | ||
menuToggle(); | ||
$('.title-bar').foundation('toggleMenu'); | ||
togglePageBody(true); | ||
} | ||
$( '.site-search i' ).addClass('fa-close').removeClass('fa-search'); | ||
$('.site-search span').text( ( $('.site-search span' ).text() == 'Search' ) ? 'Close' : 'Search' ); | ||
$('.site-search span').text( ( $('.site-search span' ).text() === 'Search' ) ? 'Close' : 'Search' ); | ||
@@ -273,3 +258,2 @@ $('body').addClass('no-scroll'); | ||
$('.site-search-dropdown').on('hide.zf.dropdown', function() { | ||
@@ -282,3 +266,3 @@ $( '.site-search i' ).removeClass('fa-close').addClass('fa-search'); | ||
function drilldownMenuHeight(){ | ||
if (Foundation.MediaQuery.current == 'small') { | ||
if (Foundation.MediaQuery.current === 'small') { | ||
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | ||
@@ -298,3 +282,3 @@ | ||
//check window width for mobile devices to prevent window resize on scroll. | ||
if ($(window).width() != windowWidth) { | ||
if ($(window).width() !== windowWidth) { | ||
windowWidth = $(window).width(); | ||
@@ -324,3 +308,3 @@ | ||
$('.search-field').focusout(function() { | ||
if ( Foundation.MediaQuery.current == 'small' ) { | ||
if ( Foundation.MediaQuery.current === 'small' ) { | ||
window.scrollTo(0, 0); | ||
@@ -337,3 +321,3 @@ } | ||
$('#filter-list input').keypress(function(event){ | ||
if(event.keyCode == 13) { | ||
if(event.keyCode === 13) { | ||
event.preventDefault(); | ||
@@ -356,42 +340,2 @@ return false; | ||
//Homepage Feedback Form | ||
$('[data-toggle="feedback"]').click(function() { | ||
$('[data-type="feedback-form"] iframe').css( 'height', ''); | ||
var formOffset = $('[data-toggle="feedback"]').offset(); | ||
var stickyHeight = $('.sticky-container').outerHeight(); | ||
if ( $('#wpadminbar').length ){ | ||
var wpadminbarHeight = $('#wpadminbar').outerHeight(); | ||
} else { | ||
var wpadminbarHeight = 0; | ||
} | ||
var formPosition = formOffset.top - ( stickyHeight + wpadminbarHeight ); | ||
$('[data-type="feedback-form"] iframe').attr('onload',"window.parent.scrollTo(0," + formPosition + ")"); | ||
if ( $('[data-type="feedback-indicator"]').hasClass('up') ){ | ||
$('[data-type="feedback-form"]').slideToggle( function(){ | ||
$('[data-type="feedback-indicator"]').removeClass('up'); | ||
$('[data-type="feedback-footer"]').toggle(); | ||
}); | ||
} else { | ||
$('[data-type="feedback-form"]').slideToggle(); | ||
$('[data-type="feedback-indicator"]').addClass('up'); | ||
$('[data-type="feedback-footer"]').toggle(); | ||
} | ||
}); | ||
//Beta tester form | ||
if ( $('[data-type="data-beta-tester-form"]').length ){ | ||
var formOffset = $('[data-type="data-beta-tester-form"]').offset(); | ||
var stickyHeight = $('.sticky-container').outerHeight(); | ||
if ( $('#wpadminbar').length ){ | ||
var wpadminbarHeight = $('#wpadminbar').outerHeight(); | ||
} else { | ||
var wpadminbarHeight = 0; | ||
} | ||
var formPosition = formOffset.top - ( stickyHeight + wpadminbarHeight ); | ||
$('[data-type="data-beta-tester-form"] iframe').attr('onload',"window.parent.scrollTo(0," + formPosition + ")"); | ||
} | ||
// Staff summary expand | ||
@@ -408,20 +352,2 @@ $('[data-toggle="data-staff-bio"]').click(function(e){ | ||
/* Async loaded feedback forms */ | ||
$.fn.feedbackify = function( src ) { | ||
postscribe('#form-container', '<script type="text/javascript" src="' + src + '"><\/script>'); | ||
$('html,body').animate({ | ||
scrollTop: $('.feedback').position().top - $('header .is-stuck').height() | ||
}, 700 ); | ||
return false; | ||
}; | ||
$("footer .feedback").on('click', function(){ | ||
$(this).feedbackify('https://form.jotform.com/jsform/62765090493967'); | ||
}); | ||
$(".neighborhood-resources .feedback").on('click', function(){ | ||
$(this).feedbackify('https://form.jotform.com/jsform/62516788470970'); | ||
}); | ||
//foundation equalizer rows | ||
@@ -428,0 +354,0 @@ //doesn't work with nested Equalizers, because a unique ID is required. |
@@ -1,2 +0,2 @@ | ||
module.export = $(function(){ | ||
module.exports = $(function(){ | ||
//inspired by https://github.com/smasala/responsive-tables-js | ||
@@ -3,0 +3,0 @@ |
//provide logo fallback for old browsers. Thanks https://css-tricks.com/a-complete-guide-to-svg-fallbacks/ | ||
module.export = function svg(){ | ||
module.exports = function svg(){ | ||
@@ -4,0 +4,0 @@ function svgasimg() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2581490
20376
3
57
+ Addedpostscribe@^2.0.8
+ Addedpostscribe@2.0.8(transitive)
+ Addedprescribe@1.1.3(transitive)