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

@ministryofjustice/frontend

Package Overview
Dependencies
Maintainers
21
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ministryofjustice/frontend - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

39

moj/all.js

@@ -1197,25 +1197,12 @@ ;(function(root, factory) {

MOJFrontend.SortableTable.prototype.sort = function(rows, columnNumber, sortDirection) {
var newRows = rows.sort($.proxy(function(rowA, rowB) {
var newRows = rows.sort((function(rowA, rowB) {
var tdA = $(rowA).find('td,th').eq(columnNumber);
var tdB = $(rowB).find('td,th').eq(columnNumber);
var valueA = this.getCellValue(tdA);
var valueB = this.getCellValue(tdB);
if(sortDirection === 'ascending') {
if(valueA < valueB) {
return -1;
}
if(valueA > valueB) {
return 1;
}
return 0;
} else {
if(valueB < valueA) {
return -1;
}
if(valueB > valueA) {
return 1;
}
return 0;
}
}, this));
var valueA = sortDirection === 'ascending' ? this.getCellValue(tdA) : this.getCellValue(tdB);
var valueB = sortDirection === 'ascending' ? this.getCellValue(tdB) : this.getCellValue(tdA);
if (typeof valueA === 'string' || typeof valueB === 'string') return valueA.toString().localeCompare(valueB.toString());
return valueA-valueB;
}.bind(this)));
return newRows;

@@ -1225,8 +1212,6 @@ };

MOJFrontend.SortableTable.prototype.getCellValue = function(cell) {
var val = cell.attr('data-sort-value');
val = val || cell.html();
if($.isNumeric(val)) {
val = parseInt(val, 10);
}
return val;
var val = cell.attr('data-sort-value') || cell.html();
var floatVal = parseFloat(val)
return isNaN(floatVal) ? val : floatVal
};

@@ -1233,0 +1218,0 @@

@@ -106,25 +106,12 @@ MOJFrontend.SortableTable = function(params) {

MOJFrontend.SortableTable.prototype.sort = function(rows, columnNumber, sortDirection) {
var newRows = rows.sort($.proxy(function(rowA, rowB) {
var newRows = rows.sort((function(rowA, rowB) {
var tdA = $(rowA).find('td,th').eq(columnNumber);
var tdB = $(rowB).find('td,th').eq(columnNumber);
var valueA = this.getCellValue(tdA);
var valueB = this.getCellValue(tdB);
if(sortDirection === 'ascending') {
if(valueA < valueB) {
return -1;
}
if(valueA > valueB) {
return 1;
}
return 0;
} else {
if(valueB < valueA) {
return -1;
}
if(valueB > valueA) {
return 1;
}
return 0;
}
}, this));
var valueA = sortDirection === 'ascending' ? this.getCellValue(tdA) : this.getCellValue(tdB);
var valueB = sortDirection === 'ascending' ? this.getCellValue(tdB) : this.getCellValue(tdA);
if (typeof valueA === 'string' || typeof valueB === 'string') return valueA.toString().localeCompare(valueB.toString());
return valueA-valueB;
}.bind(this)));
return newRows;

@@ -134,8 +121,6 @@ };

MOJFrontend.SortableTable.prototype.getCellValue = function(cell) {
var val = cell.attr('data-sort-value');
val = val || cell.html();
if($.isNumeric(val)) {
val = parseInt(val, 10);
}
return val;
var val = cell.attr('data-sort-value') || cell.html();
var floatVal = parseFloat(val)
return isNaN(floatVal) ? val : floatVal
};
{
"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": "2.1.0",
"version": "2.1.1",
"main": "moj/all.js",

@@ -6,0 +6,0 @@ "sass": "moj/all.scss",

Sorry, the diff of this file is too big to display

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