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

govuk_frontend_toolkit

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

govuk_frontend_toolkit - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

govuk_frontend_toolkit/spec/unit/SelectionButtonSpec.js

43

govuk_frontend_toolkit/Gruntfile.js
module.exports = function(grunt) {
var allSassFiles = [];
var path = require('path');
grunt.file.recurse(
"./stylesheets/",
function(abspath, rootdir, subdir, filename) {
if(typeof subdir !== 'undefined'){
var relpath = subdir + '/' + filename;
} else {
var relpath = filename;
}
if (filename.match(/\.scss/)) {
allSassFiles.push("@import '" + relpath + "';");
}
}
);
grunt.file.write(
"./spec/stylesheets/test.scss",
allSassFiles.join("\n")
);
grunt.initConfig({
clean: {
sass: ["spec/stylesheets/test*css"]
},
jasmine: {

@@ -14,7 +40,22 @@ javascripts: {

}
},
sass: {
development: {
files: {
'./spec/stylesheets/test-out.css': './spec/stylesheets/test.scss'
},
options: {
loadPath: [
'./stylesheets'
],
style: 'nested',
}
},
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('test', ['jasmine']);
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('test', ['sass', 'clean', 'jasmine']);
grunt.registerTask('default', ['test']);
};

12

govuk_frontend_toolkit/javascripts/govuk/selection-buttons.js

@@ -58,5 +58,5 @@ (function () {

RadioButtons.prototype.getSelections = function () {
var selectionEventHandler = this.markSelected.bind(this),
selections = {};
var selectionEventHandler = this.markSelected.bind(this);
this.selections = {};
$.each(this.$elms, function (index, elm) {

@@ -66,11 +66,9 @@ var $elm = $(elm),

if (typeof selections[radioName] === 'undefined') {
selections[radioName] = false;
if (typeof this.selections[radioName] === 'undefined') {
this.selections[radioName] = false;
}
if ($elm.is(':checked')) {
selectionEventHandler($elm);
selections[radioName] = $elm;
}
});
this.selections = selections;
}.bind(this));
};

@@ -77,0 +75,0 @@ RadioButtons.prototype.bindEvents = function () {

@@ -8,3 +8,5 @@ {

"grunt-cli": "0.1.11",
"grunt-contrib-clean":"~0.6.0",
"grunt-contrib-jasmine": "~0.5.2",
"grunt-contrib-sass": "0.7.4",
"jquery-browser": "~1.7.2-3"

@@ -11,0 +13,0 @@ },

@@ -24,2 +24,10 @@ # GOV.UK Frontend Toolkit

### Composer
[govuk_frontend_toolkit_composer][toolkit_composer_github] is an composer package that can be
[added to your composer.json][toolkit_composer_github_usage]
[toolkit_composer_github]: https://github.com/PurpleBooth/govuk_frontend_toolkit_composer
[toolkit_composer_github_usage]: https://github.com/PurpleBooth/govuk_frontend_toolkit_composer#installing
### Other projects

@@ -26,0 +34,0 @@

@@ -8,3 +8,4 @@ // files are loaded from the /spec/support folder so paths are relative to that

'../../javascripts/govuk/stick-at-top-when-scrolling.js',
'../../javascripts/govuk/stop-scrolling-at-footer.js'
'../../javascripts/govuk/stop-scrolling-at-footer.js',
'../../javascripts/govuk/selection-buttons.js'
],

@@ -14,4 +15,5 @@ test : [

'../unit/PrimaryLinksSpec.js',
'../unit/StickAtTopWhenScrollingSpec.js'
'../unit/StickAtTopWhenScrollingSpec.js',
'../unit/SelectionButtonSpec.js'
]
};
{
"name": "govuk_frontend_toolkit",
"version": "1.5.0",
"version": "1.6.0",
"description": "npm for govuk_frontend_toolkit",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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