@ministryofjustice/frontend
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -177,5 +177,9 @@ ;(function(root, factory) { | ||
item.find('[data-name]').each(function(i, el) { | ||
var originalId = el.id | ||
el.name = $(el).attr('data-name').replace(/%index%/, index); | ||
el.id = $(el).attr('data-id').replace(/%index%/, index); | ||
($(el).siblings('label')[0] || $(el).parents('label')[0]).htmlFor = el.id; | ||
var label = $(el).siblings('label')[0] || $(el).parents('label')[0] || item.find('[for="' + originalId + '"]')[0]; | ||
label.htmlFor = el.id; | ||
}); | ||
@@ -182,0 +186,0 @@ }; |
@@ -45,5 +45,9 @@ MOJFrontend.AddAnother = function(container) { | ||
item.find('[data-name]').each(function(i, el) { | ||
var originalId = el.id | ||
el.name = $(el).attr('data-name').replace(/%index%/, index); | ||
el.id = $(el).attr('data-id').replace(/%index%/, index); | ||
($(el).siblings('label')[0] || $(el).parents('label')[0]).htmlFor = el.id; | ||
var label = $(el).siblings('label')[0] || $(el).parents('label')[0] || item.find('[for="' + originalId + '"]')[0]; | ||
label.htmlFor = el.id; | ||
}); | ||
@@ -50,0 +54,0 @@ }; |
{ | ||
"name": "@ministryofjustice/frontend", | ||
"description": "The MOJ Frontend contains the code you need to start building user interfaces for UK Ministry of Justice government services.", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"main": "moj/all.js", | ||
@@ -6,0 +6,0 @@ "sass": "moj/all.scss", |
551156
10008