Permalink
Browse files

Use sindexOf on mailto plugin

  • Loading branch information...
1 parent 8c76a86 commit ff71e76f2f79096e1e095ae4ae4654942426ead3 @eduardocereto eduardocereto committed Apr 10, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/core.js
  2. +2 −1 src/plugins/mailto.js
View
2 src/core.js
@@ -39,7 +39,7 @@ var document = window.document,
*/
function GAS() {
var self = this;
- self['version'] = '1.6';
+ self['version'] = '1.7';
self._accounts = {};
self._accounts_length = 0;
self._queue = _prev_gas;
View
3 src/plugins/mailto.js
@@ -27,7 +27,8 @@ var _gasTrackMailto = function(opts) {
this._liveEvent('a', 'mousedown', function(e) {
var el = e.target;
- if (el && el.href && el.href.toLowerCase().indexOf('mailto:') === 0) {
+ if (el && el.href && el.href.toLowerCase &&
+ sindexOf.call(el.href.toLowerCase(), 'mailto:') === 0) {
_gas.push(['_trackEvent', opts['category'], el.href.substr(7)]);
}
});

0 comments on commit ff71e76

Please sign in to comment.