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);
// 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;
}