govuk_frontend_toolkit
Advanced tools
Comparing version 1.5.0 to 1.6.0
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']); | ||
}; |
@@ -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
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
477046
1382
0