Last active
February 7, 2018 17:35
Revisions
-
kyle-mccarthy revised this gist
Feb 7, 2018 . 1 changed file with 4 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,9 @@ var callrailGoogleMaps = { getNumbers: function() { var self = this; window.CallTrk.getSwapNumbers(null, function(nums) { self.swapNumbers(nums); }); }, getMapPoints: function() { if (mapping !== undefined) { @@ -29,7 +27,7 @@ var callrailGoogleMaps = { }, init: function() { var self = this; if (window.mapping === undefined || window.CallTrk === undefined) { setTimeout(function() { self.init(); }, 500) -
kyle-mccarthy created this gist
Feb 7, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ var callrailGoogleMaps = { getNumbers: function() { var self = this; if (window.CallTrk !== undefined) { window.CallTrk.getSwapNumbers(null, function(nums) { self.swapNumbers(nums); }); } }, getMapPoints: function() { if (mapping !== undefined) { return mapping.mapPoint.alllocmap.points; } return []; }, swapNumbers: function(nums) { this.getMapPoints().forEach(function(p) { var n = Number(p.appointments.replace(/-/g, '')); if (nums[n] !== undefined) { var fmtd = (nums[n] + "").replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); p.appointments = fmtd; } }); this.reloadMap(); }, reloadMap: function() { mapping.load() }, init: function() { var self = this; if (window.mapping === undefined) { setTimeout(function() { self.init(); }, 500) } else { this.getNumbers(); } } }; callrailGoogleMaps.init();