Permalink
Browse files

fix some minor bugs

  • Loading branch information...
1 parent d61aedc commit ee3ebae0b16470c0e6a6c1654d86e491ac32a036 Fiachra O'Donoghue committed May 18, 2012
Showing with 22 additions and 8 deletions.
  1. +3 −2 css/style.css
  2. +19 −6 js/mapdata.js
View
@@ -4,7 +4,7 @@ html, body {
}
body {
- /* background: #fff !important; */
+ background: #fff !important;
}
#datasetTitle {
@@ -230,4 +230,5 @@ input { vertical-align: -2px; }
.ui-tabs-panel {
text-align: left;
-}
+}
+
View
@@ -25,8 +25,7 @@ $(function() {
});
- $('.localData').live('change', dataBlackBox);
- $('.remoteData').on('click', dataBlackBox);
+ $('div#menu').on('change', '.localData', dataBlackBox).on('click', '.remoteData', dataBlackBox);
$('.dragView').draggable({ containment: 'parent', handle: '.dialogHeader' });
//$('#viewDetailDialog').resizable({handles: 's'});
@@ -35,6 +34,8 @@ $(function() {
$('#layerControls').css('left', '60px').css('top', '70px');
});
+ $('body').addClass('YlGn');
+
$(window).resize(function() {
leg.render();
});
@@ -458,7 +459,7 @@ $(function() {
var id = $(this).attr('id');
var model = collection.getByCid(id);
var viewDetail = new MapDataDetailGrid({model: model, el: viewDetailGrid});
-
+
var d = $('#viewDetailDialog')
if (d.css('left') === '-10000px') {
d.css('left', '100px').css('top', '70px').css('z-index', 1000);
@@ -686,7 +687,7 @@ $(function() {
var grid = new Slick.Grid(this.el, collection, gridCols, gridOpts);
grid.registerPlugin(new Slick.AutoTooltips());
- grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));
+ grid.setSelectionModel(new Slick.RowSelectionModel({})); //selectActiveRow: true
// Sorting
@@ -761,17 +762,24 @@ $(function() {
_.each(modelData, function(v, k) {
var idx = _.indexOf(bData[areaType].id, k);
var name = bData[areaType].name[idx];
- if (colNameType !== 're') {
+ if (colNameType === 'co') {
var regIdx = _.indexOf(bData.regnuts3.id, bData[areaType].reg[idx]);
var region = bData.regnuts3.name[regIdx];
dataArray.push({code: k, val: v, name: name, region: region});
}
+ else if (colNameType === 'ed') {
+ var coCode = k.substring(0,2);
+ var coIdx = _.indexOf(bData.coadm.id, coCode);
+ var county = bData.coadm.name[coIdx];
+ dataArray.push({code: k, val: v, name: name, county: county});
+ }
else {
dataArray.push({code: k, val: v, name: name});
}
});
var colNames = {
+ ed: [ 'ID', 'ED' ],
co: [ 'ID', 'County' ],
re: [ 'ID', 'Region' ],
de: [ 'ID', 'Name' ]
@@ -782,10 +790,15 @@ $(function() {
{ id: 'areaName', name: colNames[colNameType][1], field: 'name', sortable: true },
{ id: 'dataVal', name: 'Value', field: 'val', sortable: true }
];
- if (colNameType !== 're') {
+ if (colNameType === 'co') {
gridCols.splice(1, 0, {id: 'region', name: 'Region', field: 'region', sortable: true });
}
+ if (colNameType === 'ed') {
+ gridCols.splice(1, 0, {id: 'county', name: 'County', field: 'county', sortable: true });
+ }
+
+
var gridOpts = _.extend({}, {
multiColumnSort: true,
editable: false,

0 comments on commit ee3ebae

Please sign in to comment.