Don't close the sidebar when the visibility of the data layer changes
if the browser isn't active. Closes #2684.
This commit is contained in:
parent
ce85092f57
commit
1997f1f662
2 changed files with 7 additions and 8 deletions
|
@ -2,7 +2,6 @@ page.replace_html :sidebar_title, t('browse.start_rjs.data_frame_title')
|
||||||
page.replace_html :sidebar_content, :partial => 'start'
|
page.replace_html :sidebar_content, :partial => 'start'
|
||||||
page << <<EOJ
|
page << <<EOJ
|
||||||
var browseBoxControl;
|
var browseBoxControl;
|
||||||
var browseActive;
|
|
||||||
var browseMode = "auto";
|
var browseMode = "auto";
|
||||||
var browseBounds;
|
var browseBounds;
|
||||||
var browseFeatureList;
|
var browseFeatureList;
|
||||||
|
@ -15,7 +14,7 @@ page << <<EOJ
|
||||||
OpenLayers.Feature.Vector.style['default'].cursor = "pointer";
|
OpenLayers.Feature.Vector.style['default'].cursor = "pointer";
|
||||||
|
|
||||||
function startBrowse() {
|
function startBrowse() {
|
||||||
browseActive = true;
|
map.dataLayer.active = true;
|
||||||
|
|
||||||
openSidebar({ onclose: stopBrowse });
|
openSidebar({ onclose: stopBrowse });
|
||||||
|
|
||||||
|
@ -47,8 +46,8 @@ page << <<EOJ
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopBrowse() {
|
function stopBrowse() {
|
||||||
if (browseActive) {
|
if (map.dataLayer.active) {
|
||||||
browseActive = false;
|
map.dataLayer.active = false;
|
||||||
|
|
||||||
if (browseSelectControl) {
|
if (browseSelectControl) {
|
||||||
browseSelectControl.destroy();
|
browseSelectControl.destroy();
|
||||||
|
@ -154,7 +153,7 @@ page << <<EOJ
|
||||||
}
|
}
|
||||||
|
|
||||||
function customDataLoader(request) {
|
function customDataLoader(request) {
|
||||||
if (browseActive) {
|
if (this.map.dataLayer.active) {
|
||||||
var doc = request.responseXML;
|
var doc = request.responseXML;
|
||||||
|
|
||||||
if (!doc || !doc.documentElement) {
|
if (!doc || !doc.documentElement) {
|
||||||
|
@ -238,9 +237,9 @@ page << <<EOJ
|
||||||
}
|
}
|
||||||
|
|
||||||
function dataLoaded() {
|
function dataLoaded() {
|
||||||
if (browseActive) {
|
if (this.map.dataLayer.active) {
|
||||||
clearStatus();
|
clearStatus();
|
||||||
|
|
||||||
browseObjectList = document.createElement("div")
|
browseObjectList = document.createElement("div")
|
||||||
|
|
||||||
var heading = document.createElement("p");
|
var heading = document.createElement("p");
|
||||||
|
|
|
@ -182,7 +182,7 @@ end
|
||||||
function toggleData() {
|
function toggleData() {
|
||||||
if (map.dataLayer.visibility) {
|
if (map.dataLayer.visibility) {
|
||||||
<%= remote_function :url => { :controller => 'browse', :action => 'start' } %>
|
<%= remote_function :url => { :controller => 'browse', :action => 'start' } %>
|
||||||
} else {
|
} else if (map.dataLayer.active) {
|
||||||
closeSidebar();
|
closeSidebar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue