Jump to content

MediaWiki:Common.js: Difference between revisions

removing all but one alert(); either the code fires or it doesn't...
(only seems to work the first few times I try it; what gives?)
(removing all but one alert(); either the code fires or it doesn't...)
Line 545: Line 545:
                         if ($(theTable).hasClass(colOption))
                         if ($(theTable).hasClass(colOption))
                         {
                         {
                            alert("Table " + j + " wants to sort by column " + col);
                             sortColumnNum = col;
                             sortColumnNum = col;


                             // Now look for sort button and click it
                             // Now look for sort button and click it
                             var allTHs = theTable.getElementsByTagName("th");
                             var allTHs = theTable.getElementsByTagName("th");
                             if (!allTHs)
                             if (!allTHs) continue;
                            {
                                alert("Failed to get 'th' elements!");
                                continue;
                            }
                            alert("Searching " + allTHs.length + " 'th's for sort button for column " + sortColumnNum);
                             for (var k = 0; k < allTHs.length; k++)
                             for (var k = 0; k < allTHs.length; k++)
                             {
                             {
                                alert("Class names for 'th' # " + k + " are " + allTHs[k].className);
                                 if ($(allTHs[k]).hasClass("headerSort"))
                                 if ($(allTHs[k]).hasClass("headerSort"))
                                 {
                                 {