Plugin AP List: New Features
Clicking the current "Enemy" or "Friendly" label again will scroll the sidebar to top.
This commit is contained in:
parent
0a9b80a386
commit
de284ec883
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-ap-list@xelio
|
||||
// @name IITC plugin: AP List
|
||||
// @version 0.4.1.@@DATETIMEVERSION@@
|
||||
// @version 0.4.2.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -408,22 +408,24 @@ window.plugin.apList.getAttackApGain = function(d) {
|
||||
|
||||
// Change display table to friendly portals
|
||||
window.plugin.apList.displayFriendly = function() {
|
||||
plugin.apList.displaySide = plugin.apList.SIDE_FRIENDLY;
|
||||
plugin.apList.changeDisplaySide(plugin.apList.displaySide);
|
||||
plugin.apList.changeDisplaySide(plugin.apList.SIDE_FRIENDLY);
|
||||
}
|
||||
|
||||
// Change display table to enemy portals
|
||||
window.plugin.apList.displayEnemy = function() {
|
||||
plugin.apList.displaySide = plugin.apList.SIDE_ENEMY;
|
||||
plugin.apList.changeDisplaySide(plugin.apList.displaySide);
|
||||
plugin.apList.changeDisplaySide(plugin.apList.SIDE_ENEMY);
|
||||
}
|
||||
|
||||
window.plugin.apList.changeDisplaySide = function(side) {
|
||||
var isChange = (plugin.apList.displaySide !== side);
|
||||
var scrollTo = 0;
|
||||
if(isChange) {
|
||||
plugin.apList.displaySide = side;
|
||||
plugin.apList.updatePortalTable(side);
|
||||
plugin.apList.toggleSideLabel(side);
|
||||
|
||||
var scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
|
||||
- $("#sidebar").height() + $("#sidebar").scrollTop()
|
||||
scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
|
||||
- $("#sidebar").height() + $("#sidebar").scrollTop();
|
||||
}
|
||||
$('#sidebar').scrollTop(scrollTo);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user