Skip to content

Commit

Permalink
Story 1986: Updates to allow max rows before disabling plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
at88mph committed Nov 15, 2016
1 parent 6adb563 commit ead37ce
Showing 1 changed file with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -53,6 +52,7 @@
fovFieldID: "fov",
colour: "orange",
navigateToSelected: true,
maxRowCount: false,
highlightColour: "yellow",
/**
* Perform further calculations on the FOV before setting it. Useful
Expand Down Expand Up @@ -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");
}
}
});

Expand Down

0 comments on commit ead37ce

Please sign in to comment.