/*+********************************************************************************** * Advanced Funnel Charts by SalesPlatform * Copyright (C) 2011-2016 SalesPlatform Ltd * All Rights Reserved. * This extension is licensed to be used within one instance of Vtiger CRM. * Source code or binaries may not be redistributed unless expressly permitted by SalesPlatform Ltd. * If you have any questions or comments, please email: extensions@salesplatform.ru ************************************************************************************/ Vtiger_Widget_Js('Vtiger_SPFunnelCharts_Widget_Js', {},{ spFunnelPostLoadEvent : 'Vtiget.Dashboard.SPFunnelLoaded', stepsPopupInfo : [], stepsDetailURL : [], init : function (container) { this._super(container); this.registerWidgetPostLoadNotificate(); }, registerWidgetPostLoadNotificate : function() { var thisInstance = this; $(document).on(this.spFunnelPostLoadEvent, function(e) { if(!thisInstance.isEmptyData()) { thisInstance.loadChart(); } }); }, postLoadWidget: function() { this._super(); var thisInstance = this; /* No hide overflow for popup */ var container = this.getContainer(); $(".slimScrollDiv", container).css('overflow', 'visible'); $(".dashboardWidgetContent", container).css('overflow', 'visible'); container.on("mousemove", function(event) { $('#funnel_popup').offset({ top: event.clientY - $('#funnel_popup').height() - 25, left: event.clientX - $('#funnel_popup').width()/2 }); }); container.on("jqplotDataHighlight", function(evt, seriesIndex, pointIndex, neighbor) { $('#funnel_popup', thisInstance.getContainer()).remove(); $('.jqplot-event-canvas', thisInstance.getContainer()).css( 'cursor', 'pointer' ); var displayDataElements = $('.jqplot-data-label', thisInstance.getContainer()); var bindedPopupElement = $(displayDataElements[pointIndex]).find("#funnel_popup"); if(thisInstance.stepsPopupInfo[pointIndex] !== '' && bindedPopupElement.length === 0) { var popupElement = $('