(function(ns) { "use strict"; /** * @alias app.utilityCategory.View * @constructor */ ns.DetailPage = function () { this.construct.apply(this, arguments); }; ns.DetailPage.prototype.construct = function () { this.eventNS = 'utilityCategory'; this.infoElements = $('li.category-info a'); this.currentTip = null; this.infoElements.tooltip({trigger: 'manual'}); if ('ontouchstart' in window) { $(window).on('orientationchange.' + this.eventNS, _.bind(this.onOrientationChange, this)); this.infoElements.on('touchend.' + this.eventNS, _.bind(this.onTouchEnd, this)); } else { this.infoElements.on('mouseover.' + this.eventNS, _.bind(this.showTooltip, this)); this.infoElements.on('mouseout.' + this.eventNS, _.bind(this.hideTooltip, this)); } }; ns.DetailPage.prototype.showTooltip = function (ev) { this.hideTooltip(); this.currentTip = $(ev.target); this.currentTip.tooltip('show'); }; ns.DetailPage.prototype.hideTooltip = function () { if (this.currentTip) { this.currentTip.tooltip('hide'); this.currentTip = null; } }; ns.DetailPage.prototype.onOrientationChange = function () { this.hideTooltip(); return false; }; ns.DetailPage.prototype.onTouchEnd = function (ev) { if (!$(ev.target).hasClass('symbol')) { this.hideTooltip(); } else { this.showTooltip(ev); } return false; }; })(qs.defineNS('app.municipalUtilities'));