Skip to content

Commit

Permalink
Execute callback when fetching data sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Hartmann committed May 25, 2013
1 parent 85d52ce commit 1634cf5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>devkat-olap4js</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
16 changes: 4 additions & 12 deletions src/olap.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,14 @@
* @param {function} callback A function to call after the databases have been retrieved from the OLAP server
*/
getOlapDatabases: function getOlapDatabases(callback){
if (this.sources.length ==0) {
var sources = this.fetchOlapDatasources() //function(sources){
if (callback && typeof callback == 'function') {
callback.call(this, sources);
} else {
return sources;
}
//});
if (this.sources.length === 0) {
return this.fetchOlapDatasources(callback);
} else {
if (callback && typeof callback == 'function') {
if (callback && typeof callback === 'function') {
callback.call(this, this.sources);
} else {
return sources;
}
return this.sources;
}
return this.sources;
},
fetchOlapDatasources: function fetchOlapDatasources(callback){
//empty function that does not fetch anything
Expand Down

0 comments on commit 1634cf5

Please sign in to comment.