From c4da27564b7c120055e837a6f79dd46a1dd3e89d Mon Sep 17 00:00:00 2001 From: Jeff Burke Date: Fri, 28 Oct 2016 12:53:13 -0700 Subject: [PATCH] s1986: disable the View in sky button if there are more than 10,000 results. --- .../cadc.plugin.footprint-viewer.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 f370580..6355e47 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,6 +29,7 @@ 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 = { @@ -162,6 +163,9 @@ lineWidth: 5 }); _self.aladin.addOverlay(_self.currentFootprint); + _self.viewAladinButton = $("#slick-visualize"); + _self.viewAladinStatus = $("#slick-visualize-status"); + _self.rowCount = 0; if (inputs.fov != null) { @@ -178,7 +182,25 @@ else { _self.viewer.subscribe(cadc.vot.events.onRowAdded, - handleAddFootprint); + function() + { + handleAddFootprint; + + if (_self.rowCount == 0) + { + // _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"); + } + }); _self.viewer.subscribe(cadc.vot.events.onDataLoaded, function ()