From ead37ce4635e65d85a8ebdbc6a6b3f0e1feb082e Mon Sep 17 00:00:00 2001 From: Dustin Jenkins Date: Tue, 15 Nov 2016 15:29:14 -0800 Subject: [PATCH] Story 1986: Updates to allow max rows before disabling plugin. --- .../cadc.plugin.footprint-viewer.js | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/cadc-votv/src/www/cadcVOTV/javascript/cadc.plugin.footprint-viewer.js b/cadc-votv/src/www/cadcVOTV/javascript/cadc.plugin.footprint-viewer.js index 6355e47..640bff0 100644 --- a/cadc-votv/src/www/cadcVOTV/javascript/cadc.plugin.footprint-viewer.js +++ b/cadc-votv/src/www/cadcVOTV/javascript/cadc.plugin.footprint-viewer.js @@ -29,7 +29,6 @@ var DEG_PER_ARC_SEC = 1.0 / 3600.0; var POLYGON_SPLIT = "Polygon ICRS"; var DEFAULT_FOV_DEGREES = 180; - var ALADIN_ROW_LIMIT = 10000; var _self = this; var _defaults = { @@ -53,6 +52,7 @@ fovFieldID: "fov", colour: "orange", navigateToSelected: true, + maxRowCount: false, highlightColour: "yellow", /** * Perform further calculations on the FOV before setting it. Useful @@ -182,23 +182,29 @@ else { _self.viewer.subscribe(cadc.vot.events.onRowAdded, - function() + function(e, args) { - handleAddFootprint; + handleAddFootprint(e, args); - if (_self.rowCount == 0) + if (inputs.maxRowCount) { - // _self.viewAladinButton.removeClass("button-disabled"); - _self.viewAladinButton.removeClass("ui-disabled"); - _self.viewAladinStatus.addClass("wb-invisible"); - } - _self.rowCount++; - if (_self.rowCount > ALADIN_ROW_LIMIT && - !(_self.viewAladinButton.hasClass("ui-disabled"))) - { - // _self.viewAladinButton.addClass("button-disabled"); - _self.viewAladinButton.addClass("ui-disabled"); - _self.viewAladinStatus.removeClass("wb-invisible"); + if (_self.rowCount === 0) + { + // _self.viewAladinButton.removeClass("button-disabled"); + _self.viewAladinButton.removeClass("ui-disabled"); + _self.viewAladinStatus.addClass("wb-invisible"); + } + + _self.rowCount++; + + if ((_self.rowCount > inputs.maxRowCount) + && (_self.viewAladinButton.hasClass( + "ui-disabled") === false)) + { + // _self.viewAladinButton.addClass("button-disabled"); + _self.viewAladinButton.addClass("ui-disabled"); + _self.viewAladinStatus.removeClass("wb-invisible"); + } } });