Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 93e9eee

Browse files
committed
style(jshint): make jshint happy
1 parent cee6808 commit 93e9eee

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

demo/demo.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
/* global console:false, google:false */
2+
/*jshint unused:false */
3+
'use strict';
4+
15
function initCall() {
2-
console.log("Google maps api initialized.");
3-
angular.bootstrap(document.getElementById("map"), ['doc.ui-map']);
6+
console.log('Google maps api initialized.');
7+
angular.bootstrap(document.getElementById('map'), ['doc.ui-map']);
48
}
59

610
angular.module('doc.ui-map', ['ui.map', 'prettifyDirective'])

gruntFile.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = function (grunt) {
24

35
require('load-grunt-tasks')(grunt);
@@ -47,10 +49,10 @@ module.exports = function (grunt) {
4749
' */',
4850
''].join('\n'),
4951
view: {
50-
humaName: "UI.Map",
51-
repoName: "ui-map",
52-
demoHTML: grunt.file.read("demo/demo.html"),
53-
demoJS: grunt.file.read("demo/demo.js"),
52+
humaName: 'UI.Map',
53+
repoName: 'ui-map',
54+
demoHTML: grunt.file.read('demo/demo.html'),
55+
demoJS: grunt.file.read('demo/demo.js'),
5456
css: [
5557
'assets/css/demos.css'
5658
],

src/ui-map.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
'use strict';
2+
13
(function () {
24
var app = angular.module('ui.map', ['ui.event']);
35

46
//Setup map events from a google map object to trigger on a given element too,
57
//then we just use ui-event to catch events from an element
68
function bindMapEvents(scope, eventsStr, googleObject, element) {
79
angular.forEach(eventsStr.split(' '), function (eventName) {
8-
//Prefix all googlemap events with 'map-', so eg 'click'
10+
//Prefix all googlemap events with 'map-', so eg 'click'
911
//for the googlemap doesn't interfere with a normal 'click' event
10-
google.maps.event.addListener(googleObject, eventName, function (event) {
12+
window.google.maps.event.addListener(googleObject, eventName, function (event) {
1113
element.triggerHandler('map-' + eventName, event);
1214
//We create an $apply if it isn't happening. we need better support for this
1315
//We don't want to use timeout because tons of these events fire at once,
@@ -31,7 +33,7 @@
3133
//doesn't work as E for unknown reason
3234
link: function (scope, elm, attrs) {
3335
var opts = angular.extend({}, options, scope.$eval(attrs.uiOptions));
34-
var map = new google.maps.Map(elm[0], opts);
36+
var map = new window.google.maps.Map(elm[0], opts);
3537
var model = $parse(attrs.uiMap);
3638

3739
//Set scope variable for the map
@@ -57,7 +59,7 @@
5759
var infoWindow = model(scope);
5860

5961
if (!infoWindow) {
60-
infoWindow = new google.maps.InfoWindow(opts);
62+
infoWindow = new window.google.maps.InfoWindow(opts);
6163
model.assign(scope, infoWindow);
6264
}
6365

@@ -79,7 +81,7 @@
7981
};
8082
}]);
8183

82-
/*
84+
/*
8385
* Map overlay directives all work the same. Take map marker for example
8486
* <ui-map-marker="myMarker"> will $watch 'myMarker' and each time it changes,
8587
* it will hook up myMarker's events to the directive dom element. Then

0 commit comments

Comments
 (0)