Skip to content

Commit

Permalink
Create linkloader iframe in script
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh authored and tomhughes committed Aug 6, 2013
1 parent b125981 commit d413539
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 12 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,21 @@ function remoteEditHandler(bbox, select) {
};

if (select) query.select = select;
$("#linkloader")

var iframe = $('<iframe>')
.hide()
.appendTo('body')
.attr("src", "http://127.0.0.1:8111/load_and_zoom?" + querystring.stringify(query))
.load(function() { loaded = true; });
.on('load', function() {
$(this).remove();
loaded = true;
});

setTimeout(function () {
if (!loaded) alert(I18n.t('site.index.remote_failed'));
if (!loaded) {
alert(I18n.t('site.index.remote_failed'));
iframe.remove();
}
}, 1000);

return false;
Expand Down
3 changes: 0 additions & 3 deletions app/views/browse/_map.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<iframe id="linkloader" style="display: none">
</iframe>

<div id="browse_map" class='clearfix content_map'>
<% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %>

Expand Down
3 changes: 0 additions & 3 deletions app/views/site/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<div id="map" tabindex="2">
</div>

<iframe id="linkloader" style="display: none">
</iframe>

<div id="attribution">
<table width="100%">
<tr>
Expand Down

0 comments on commit d413539

Please sign in to comment.