Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
accessible_gmaps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
accessibility-tools
accessible_gmaps
Commits
f3fc19d7
Commit
f3fc19d7
authored
9 years ago
by
Elijah Byrd
Browse files
Options
Downloads
Plain Diff
Finishing merge of lazyShimLoad branch
parents
7101cd2c
3c3e0848
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
accessible_gmaps.js
+26
-6
26 additions, 6 deletions
accessible_gmaps.js
with
26 additions
and
6 deletions
accessible_gmaps.js
+
26
−
6
View file @
f3fc19d7
...
...
@@ -4,7 +4,6 @@
function
load_accessible_gmaps
(){
var
accessible_gmaps
=
{};
// TODO: properly isolate these global variables so they don't cause trouble when dropped into other sites
accessible_gmaps
.
markers
=
[];
accessible_gmaps
.
infowindowsEnabled
;
accessible_gmaps
.
map
;
...
...
@@ -177,9 +176,20 @@
jQuery
(
'
div#map-controls
'
).
after
(
'
<div id="
'
+
markerID
+
'
" title="
'
+
title
+
'
" class="map-marker" tabindex="0"><span>
'
+
title
+
'
</span></div>
'
);
jQuery
(
'
div#
'
+
markerID
).
data
(
'
markerID
'
,
markerIndex
)
// Data attribute is added to the div so its associated marker can be identified.
// Bind events to the marker hover to reposition its shim:
marker
.
addListener
(
'
mouseover
'
,
function
()
{
accessible_gmaps
.
resetMarker
(
markerIndex
,
accessible_gmaps
.
getMapData
());
});
// Bind events to the marker overlay to manipulate its marker's z index.
jQuery
(
'
div#
'
+
markerID
).
focus
(
accessible_gmaps
.
zUp
);
jQuery
(
'
div#
'
+
markerID
).
blur
(
accessible_gmaps
.
zDown
);
jQuery
(
'
div#
'
+
markerID
).
focus
(
function
(){
//accessible_gmaps.zUp
accessible_gmaps
.
resetMarker
(
markerIndex
,
accessible_gmaps
.
getMapData
());
});
jQuery
(
'
div#
'
+
markerID
).
blur
(
function
(){
//accessible_gmaps.zDown
accessible_gmaps
.
resetMarker
(
markerIndex
,
accessible_gmaps
.
getMapData
());
});
// If the accessible infowindows module is enabled, bind handlers to open the modal infowindow.
if
(
accessible_gmaps
.
infowindowsEnabled
){
...
...
@@ -332,13 +342,23 @@
}
/**
* Wrapper function for resetMarker
* that resets all markers in the markers array.
* Moves all marker shims off-screen.
*/
accessible_gmaps
.
resetAllMarkers
=
function
(){
var
mapData
=
accessible_gmaps
.
getMapData
();
var
bounds
=
accessible_gmaps
.
map
.
getBounds
();
for
(
var
i
=
0
;
i
<
accessible_gmaps
.
markers
.
length
;
i
++
){
accessible_gmaps
.
resetMarker
(
i
,
mapData
);
var
marker
=
accessible_gmaps
.
markers
[
i
];
var
markerID
=
"
mkr-
"
+
i
;
// If marker is not in bounds, hide the overlay.
if
(
!
bounds
.
contains
(
marker
.
getPosition
())){
jQuery
(
'
div#
'
+
markerID
).
css
(
'
display
'
,
'
none
'
);
}
// If the marker is in bounds, position the overlay off-screen. This will keep it from receiving incorrect mouse hover, until it is repositioned by its marker's hover or its own focus event.
else
{
jQuery
(
'
div#
'
+
markerID
).
css
(
'
left
'
,
'
-2000px
'
);
jQuery
(
'
div#
'
+
markerID
).
css
(
'
top
'
,
'
-2000px
'
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment