YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/OSSTimeControl/resources/InRelation.min.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */"use strict";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}jQuery(document).ready(function($){window.loadInRelationTomeControl==null&&jQuery.Class("OSSTimeControl_Calendar_Js",{},{chart:!1,loadChart:function loadChart(){var data=$(".sumaryRelatedTimeControl .widgetData").val();if(data==null||""==data)return !1;var jdata=JSON.parse(data);return 0!=jdata.datasets.length&&0!=jdata.datasets[0].data.length&&void(jdata.datasets[0].datalabels={font:{weight:"bold"},color:"white",anchor:"end",align:"start"},new Chart($(this.chart).find("canvas")[0].getContext("2d"),{type:"bar",data:jdata,options:{tooltips:{callbacks:{labelColor:function labelColor(tooltipItem){return {borderColor:jdata.datasets[0].backgroundColor[tooltipItem.index],backgroundColor:jdata.datasets[0].borderColor[tooltipItem.index]}},title:function title(_ref){var _ref2=_slicedToArray(_ref,1),tooltipItem=_ref2[0];return jdata.datasets[0].tooltips[tooltipItem.index]},label:function label(tooltipItem){return jdata.datasets[0].dataFormatted[tooltipItem.index]}}},legend:{display:!1},title:{display:!0,position:"top",text:jdata.title},maintainAspectRatio:!1,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}}))},registerSwitch:function registerSwitch(){$(".switchChartContainer").on("click",function(){var chartContainer=$(".chartContainer")[0];$(chartContainer).is(":visible")?($(this).find(".fas").removeClass("fa-chevron-up").addClass("fa-chevron-down"),$(".chartContainer").hide()):($(this).find(".fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),$(".chartContainer").show());});},registerEvents:function registerEvents(){this.chart=$(".sumaryRelatedTimeControl .chartBlock"),this.loadChart(),this.registerSwitch();}});var instance=new OSSTimeControl_Calendar_Js;instance.registerEvents(),window.loadInRelationTomeControl=!0;});
//# sourceMappingURL=InRelation.min.js.map