MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 30: | Line 30: | ||
console.log(row); | console.log(row); | ||
if (row.find('a') !== null) { | if (row.find('a') !== null) { | ||
window.location = row.find('a').attr(' | window.location = row.find('a').attr('span title');; | ||
} | } | ||
}); | }); | ||
Revision as of 17:15, 10 January 2023
/* Any JavaScript here will be loaded for all users on every page load. */
/* Row click link */
$(document).ready(function() {
var rows = $('.TableShops').find('tr');
rows.on('click', function() {
var row = $(this);
console.log(row);
if (row.find('a') !== null) {
window.location = row.find('a').attr('href');;
}
});
});
/* Cell click link */
$(document).ready(function() {
var rows = $('.CRPShopTable').find('td');
rows.on('click', function() {
var row = $(this);
console.log(row);
if (row.find('a') !== null) {
window.location = row.find('a').attr('href');;
}
});
});
$(document).ready(function() {
var rows = $('.FixesTable').find('span title');
rows.on('click', function() {
var row = $(this);
console.log(row);
if (row.find('a') !== null) {
window.location = row.find('a').attr('span title');;
}
});
});
console.log("Thank you Byroo <3");