MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
/* Row click link */ | /* Row click link TableShops */ | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var rows = $('.TableShops').find('tr'); | var rows = $('.TableShops').find('tr'); | ||
| Line 12: | Line 12: | ||
}); | }); | ||
/* Cell click link */ | /* Cell click link CRPShopTable */ | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var rows = $('.CRPShopTable').find('td'); | var rows = $('.CRPShopTable').find('td'); | ||
| Line 22: | Line 22: | ||
} | } | ||
}); | }); | ||
}); | |||
/* Tooltip on whole row hover FixesTable */ | |||
var rows = $('.FixesTable').find('tr'); | |||
rows.each(function() { | |||
var row = $(this); | |||
row.attr('title', row.find('td').attr('title')); | |||
}); | }); | ||
console.log("Thank you Byroo <3"); | console.log("Thank you Byroo <3"); | ||
Revision as of 17:41, 14 February 2023
/* Any JavaScript here will be loaded for all users on every page load. */
/* Row click link TableShops */
$(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 CRPShopTable */
$(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');;
}
});
});
/* Tooltip on whole row hover FixesTable */
var rows = $('.FixesTable').find('tr');
rows.each(function() {
var row = $(this);
row.attr('title', row.find('td').attr('title'));
});
console.log("Thank you Byroo <3");