|
From: <tob...@us...> - 2014-04-04 17:07:00
|
Revision: 8053
http://sourceforge.net/p/bigdata/code/8053
Author: tobycraig
Date: 2014-04-04 17:06:57 +0000 (Fri, 04 Apr 2014)
Log Message:
-----------
#873 - Fixed error on reloading of explore
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/js/workbench.js
Modified: branches/RDR/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-04 16:55:54 UTC (rev 8052)
+++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-04 17:06:57 UTC (rev 8053)
@@ -86,12 +86,17 @@
$('.namespace-service-description').click(function(e) {
return confirm('This can be an expensive operation. Proceed anyway?');
});
+ NAMESPACES_READY = true;
});
}
function selectNamespace(name) {
// for programmatically selecting a namespace with just its name
- $('#namespaces-list li[data-name=' + name + '] a.use-namespace').click();
+ if(!NAMESPACES_READY) {
+ setTimeout(function() { selectNamespace(name); }, 10);
+ } else {
+ $('#namespaces-list li[data-name=' + name + '] a.use-namespace').click();
+ }
}
function useNamespace(name, url) {
@@ -164,7 +169,7 @@
useNamespace(DEFAULT_NAMESPACE, url);
});
}
-var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, fileContents;
+var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, fileContents;
getDefaultNamespace();
@@ -773,11 +778,19 @@
$('#explore-results a').click(function(e) {
e.preventDefault();
var components = parseHash(this.hash);
- selectNamespace(components[2]);
- explore(components[3]);
+ exploreNamespacedURI(components[2], components[3]);
});
}
+function exploreNamespacedURI(namespace, uri, nopush) {
+ if(!NAMESPACES_READY) {
+ setTimeout(function() { exploreNamespacedURI(namespace, uri, nopush); }, 10);
+ } else {
+ selectNamespace(namespace);
+ explore(uri, nopush);
+ }
+}
+
function explore(uri, nopush) {
$('#explore-form input[type=text]').val(uri);
$('#explore-form').submit();
@@ -802,8 +815,7 @@
$('#tab-selector a:first').click();
} else {
if(hash[1] == 'explore') {
- selectNamespace(hash[2]);
- explore(hash[3], true);
+ exploreNamespacedURI(hash[2], hash[3], true);
} else {
$('a[data-target=' + hash[1] + ']').click();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|