govuk_frontend_toolkit
Advanced tools
Comparing version 4.18.4 to 5.0.0
@@ -0,1 +1,10 @@ | ||
# 5.0.0 | ||
This release includes two breaking changes: | ||
- Removal of external link styles and icons, if you are using the external-link-* mixins you will need to remove them from your codebase ([PR #293](https://github.com/alphagov/govuk_frontend_toolkit/pull/293)) | ||
- Correct spelling of the 'accordion' icon, you will need to check for the incorrect spelling 'accordian' and update if you are using this icon ([PR #345](https://github.com/alphagov/govuk_frontend_toolkit/pull/345)) | ||
And two minor changes: | ||
- Amend GOVUK.StickAtTopWhenScrolling to resize the sticky element and shim when the .js-sticky-resize class is set ([PR #343](https://github.com/alphagov/govuk_frontend_toolkit/pull/343)) | ||
- Allow custom options in GOVUK.analytics.trackPageview ([#332](https://github.com/alphagov/govuk_frontend_toolkit/pull/332)) | ||
# 4.18.4 | ||
@@ -2,0 +11,0 @@ |
;(function (global) { | ||
'use strict' | ||
var $ = global.jQuery | ||
var GOVUK = global.GOVUK || {} | ||
@@ -37,20 +38,20 @@ | ||
GoogleAnalyticsUniversalTracker.prototype.trackPageview = function (path, title, options) { | ||
options = options || {} | ||
var pageviewObject | ||
if (typeof path === 'string') { | ||
var pageviewObject = { | ||
page: path | ||
} | ||
pageviewObject = { page: path } | ||
} | ||
if (typeof title === 'string') { | ||
pageviewObject.title = title | ||
} | ||
if (typeof title === 'string') { | ||
pageviewObject = pageviewObject || {} | ||
pageviewObject.title = title | ||
} | ||
// Set the transport method for the pageview | ||
// Typically used for enabling `navigator.sendBeacon` when the page might be unloading | ||
// https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#transport | ||
if (options.transport) { | ||
pageviewObject.transport = options.transport | ||
} | ||
// Set an options object for the pageview (e.g. transport, sessionControl) | ||
// https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#transport | ||
if (typeof options === 'object') { | ||
pageviewObject = $.extend(pageviewObject || {}, options) | ||
} | ||
if (!$.isEmptyObject(pageviewObject)) { | ||
sendToGa('send', 'pageview', pageviewObject) | ||
@@ -57,0 +58,0 @@ } else { |
@@ -94,2 +94,11 @@ ;(function (global) { | ||
var elResize = $el.hasClass('js-sticky-resize') | ||
if (elResize) { | ||
var $shim = $('.shim') | ||
var $elParent = $el.parent('div') | ||
var elParentWidth = $elParent.width() | ||
$shim.css('width', elParentWidth) | ||
$el.css('width', elParentWidth) | ||
} | ||
if (windowDimensions.width <= 768) { | ||
@@ -96,0 +105,0 @@ sticky.release($el) |
{ | ||
"name": "govuk_frontend_toolkit", | ||
"version": "4.18.4", | ||
"version": "5.0.0", | ||
"description": "npm package for using the GOV.UK frontend toolkit", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,1 +0,1 @@ | ||
4.18.4 | ||
5.0.0 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
179
1416
476052