MOdified init tooltips function

This commit is contained in:
Thilanka Kaushalya 2011-07-16 20:36:31 +05:30
parent 9fad9b9810
commit 4e19ef1cbf
2 changed files with 27 additions and 13 deletions

View File

@ -63,9 +63,12 @@ $(document).ready(function() {
currrent_insert_table = $(this);
var $url = $(this).attr("href");
if ($url.substring(0, 15) == "tbl_change.php?") {
$url = $url.substring(15);
$url = $url.substring(15);
}
if ($("#insert_table_dialog").length > 0) {
$("#insert_table_dialog").remove();
}
var $div = $('<div id="insert_table_dialog"></div>');
var target = "tbl_change.php";
@ -110,10 +113,12 @@ $(document).ready(function() {
$dialog.find("#topmenucontainer").hide();
//Adding the datetime pikers for the dialog
$dialog.find('.datefield, .datetimefield').each(function () {
PMA_addDatepicker($(this));
PMA_addDatepicker($(this));
});
$(".insertRowTable").addClass("ajax");
$("#buttonYes").addClass("ajax");
$div = $("#insert_table_dialog");
initTooltips($div);
}
PMA_ajaxRemoveMessage($msgbox);
}) // end $.get()

View File

@ -2224,7 +2224,9 @@ function displayMoreTableOpts() {
}
}
$(document).ready(initTooltips);
$(document).ready(function(){
initTooltips();
});
/**
* Ensures indexes names are valid according to their type and, for a primary
@ -2262,25 +2264,32 @@ function checkIndexName(form_id)
/* Displays tooltips */
function initTooltips() {
function initTooltips($div) {
// Hide the footnotes from the footer (which are displayed for
// JavaScript-disabled browsers) since the tooltip is sufficient
$(".footnotes").hide();
$(".footnotes span").each(function() {
$(this).children("sup").remove();
if ($div == undefined || ! $div instanceof jQuery || $div.length == 0) {
$div = $("#serverinfo").parent();
}
$footnotes = $div.find(".footnotes");
$footnotes.hide();
$footnotes.find('span').each(function() {
$div.children("sup").remove();
});
// The border and padding must be removed otherwise a thin yellow box remains visible
$(".footnotes").css("border", "none");
$(".footnotes").css("padding", "0px");
$footnotes.css("border", "none");
$footnotes.css("padding", "0px");
// Replace the superscripts with the help icon
$("sup[class='footnotemarker']").hide();
$("img[class='footnotemarker']").show();
$div.children("sup[class='footnotemarker']").hide();
$div.children("img[class='footnotemarker']").show();
$("img[class='footnotemarker']").each(function() {
$div.children("img[class='footnotemarker']").each(function() {
var span_id = $(this).attr("id");
span_id = span_id.split("_")[1];
var tooltip_text = $(".footnotes span[id='footnote_" + span_id + "']").html();
var tooltip_text = $footnotes.find("span[id='footnote_" + span_id + "']").html();
$(this).qtip({
content: tooltip_text,
show: { delay: 0 },