rename hasTooltip function to isLegend

This commit is contained in:
Sanj 2011-06-27 04:02:07 +05:30
parent d04dc8ef0c
commit 9a90e9e6ed

View File

@ -57,7 +57,7 @@ $(function() {
// $this.addClass(thisData.type); // $this.addClass(thisData.type);
// console.log($this.data("key")); // console.log($this.data("key"));
// console.log($this.hasTooltip()); // console.log($this.hasTooltip());
if ($this.hasTooltip()) { if (!$this.isLegend()) {
$this.tooltip({ $this.tooltip({
'delay': 0, 'delay': 0,
'showURL': false, 'showURL': false,
@ -111,7 +111,7 @@ $(function() {
}); });
$this.click(function() { $this.click(function() {
if (!$this.hasTooltip()) { if ($this.isLegend()) {
return; return;
} }
window.open($(this).data("link")); window.open($(this).data("link"));
@ -136,18 +136,18 @@ function getPostersHTML(padma_ids) {
return html; 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') { if (typeof(this.data("key")) == 'undefined') {
return false; return true;
} }
// console.log(parseInt(this.attr("x"))); // console.log(parseInt(this.attr("x")));
if (parseInt(this.attr("x")) > 1200) { if (parseInt(this.attr("x")) > 1200) {
if ($.inArray(this.data("key"), ["Journalists", "Corporates", "Vaishnavi", "Politicians", "Issues", "Mention of,"]) != -1) { if ($.inArray(this.data("key"), ["Journalists", "Corporates", "Vaishnavi", "Politicians", "Issues", "Mention of,"]) != -1) {
return false; return true;
} else { } else {
return true; return false;
} }
} }
return true; return false;
} }