From 9a90e9e6ed7d950e3689552678443d0bae621352 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 27 Jun 2011 04:02:07 +0530 Subject: [PATCH] rename hasTooltip function to isLegend --- radia.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/radia.js b/radia.js index dc89f77..1656076 100644 --- a/radia.js +++ b/radia.js @@ -57,7 +57,7 @@ $(function() { // $this.addClass(thisData.type); // console.log($this.data("key")); // console.log($this.hasTooltip()); - if ($this.hasTooltip()) { + if (!$this.isLegend()) { $this.tooltip({ 'delay': 0, 'showURL': false, @@ -111,7 +111,7 @@ $(function() { }); $this.click(function() { - if (!$this.hasTooltip()) { + if ($this.isLegend()) { return; } window.open($(this).data("link")); @@ -136,18 +136,18 @@ function getPostersHTML(padma_ids) { return html; } -//silly hack to implement no tooltips for legend - but can also be extended to disable tooltips for some items. -jQuery.fn.hasTooltip = function() { + +jQuery.fn.isLegend = function() { if (typeof(this.data("key")) == 'undefined') { - return false; + return true; } // console.log(parseInt(this.attr("x"))); if (parseInt(this.attr("x")) > 1200) { if ($.inArray(this.data("key"), ["Journalists", "Corporates", "Vaishnavi", "Politicians", "Issues", "Mention of,"]) != -1) { - return false; - } else { return true; + } else { + return false; } } - return true; + return false; }