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==
|
// ==UserScript==
|
||||||
// @id iitc-plugin-ap-list@xelio
|
// @id iitc-plugin-ap-list@xelio
|
||||||
// @name IITC plugin: AP List
|
// @name IITC plugin: AP List
|
||||||
// @version 0.4.1.@@DATETIMEVERSION@@
|
// @version 0.4.2.@@DATETIMEVERSION@@
|
||||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||||
// @updateURL @@UPDATEURL@@
|
// @updateURL @@UPDATEURL@@
|
||||||
// @downloadURL @@DOWNLOADURL@@
|
// @downloadURL @@DOWNLOADURL@@
|
||||||
@ -408,22 +408,24 @@ window.plugin.apList.getAttackApGain = function(d) {
|
|||||||
|
|
||||||
// Change display table to friendly portals
|
// Change display table to friendly portals
|
||||||
window.plugin.apList.displayFriendly = function() {
|
window.plugin.apList.displayFriendly = function() {
|
||||||
plugin.apList.displaySide = plugin.apList.SIDE_FRIENDLY;
|
plugin.apList.changeDisplaySide(plugin.apList.SIDE_FRIENDLY);
|
||||||
plugin.apList.changeDisplaySide(plugin.apList.displaySide);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change display table to enemy portals
|
// Change display table to enemy portals
|
||||||
window.plugin.apList.displayEnemy = function() {
|
window.plugin.apList.displayEnemy = function() {
|
||||||
plugin.apList.displaySide = plugin.apList.SIDE_ENEMY;
|
plugin.apList.changeDisplaySide(plugin.apList.SIDE_ENEMY);
|
||||||
plugin.apList.changeDisplaySide(plugin.apList.displaySide);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.apList.changeDisplaySide = function(side) {
|
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.updatePortalTable(side);
|
||||||
plugin.apList.toggleSideLabel(side);
|
plugin.apList.toggleSideLabel(side);
|
||||||
|
scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
|
||||||
var scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
|
- $("#sidebar").height() + $("#sidebar").scrollTop();
|
||||||
- $("#sidebar").height() + $("#sidebar").scrollTop()
|
}
|
||||||
$('#sidebar').scrollTop(scrollTo);
|
$('#sidebar').scrollTop(scrollTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user