Skip to content

Commit

Permalink
Use sindexOf on mailto plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocereto committed Apr 10, 2012
1 parent 8c76a86 commit ff71e76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core.js
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/mailto.js
Expand Up @@ -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)]);
}
});
Expand Down

0 comments on commit ff71e76

Please sign in to comment.