Skip to content

Commit

Permalink
Merge pull request #3 from jburke-cadc/master
Browse files Browse the repository at this point in the history
s1986: disable View in sky button if greater than 10,000 results
  • Loading branch information
at88mph authored Nov 15, 2016
2 parents d71dc96 + 7492fd4 commit 6adb563
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
{
Expand All @@ -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 ()
Expand Down

0 comments on commit 6adb563

Please sign in to comment.