diff --git a/docs/api.js b/docs/api.js index 12c142db..127acdc5 100644 --- a/docs/api.js +++ b/docs/api.js @@ -205,9 +205,6 @@ function getDocsJSON() { return ret; function getDoc(key) { - var standardElement = new Ox.Element(); - var standardMethods = Ox.filter(Ox.keys(standardElement), function(m) { return typeof standardElement[m] === 'function' }); - //FIXME: eventually we want to document all Ox values and functions if (!/^[A-Z][a-z]/.test(key)) { return false @@ -219,7 +216,6 @@ function getDocsJSON() { 'functionString': functionString } } - var functionString = Ox[key].toString(); try { var o = new Ox[key](); } catch(err) { @@ -232,6 +228,7 @@ function getDocsJSON() { var opts = {}; if ('options' in o && typeof o['options'] == 'function') { var opts = o.options(); + //only inclue methods that are defined in the function var _methods = Ox.filter(Ox.keys(o), function(m) { return (functionString.indexOf('that.'+m+' =') > -1 && typeof o[m] === 'function')}); $.each(_methods, function(i, m) { methods[m] = o[m].toString() }); }