diff options
| author | Julien Bouquillon | 2013-05-10 23:06:18 +0200 |
|---|---|---|
| committer | Brian Ford | 2013-07-11 14:07:08 -0700 |
| commit | 52d6a5990225439ac9141398d83e0d4e6134b576 (patch) | |
| tree | e84f333f3ac1b4bef3696d8638fe3a89fe79f706 /docs/src/ngdoc.js | |
| parent | 8bd6619b7efa485b020fec96c76047e480469871 (diff) | |
| download | angular.js-52d6a5990225439ac9141398d83e0d4e6134b576.tar.bz2 | |
feat(ngDocs): add links to source for API
- add tests
- the link points to the gruntUtil.getVersion().number tree on github
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index af78c1e3..dc75d5cb 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -378,7 +378,16 @@ Doc.prototype = { dom.h(title(this.name), function() { notice('deprecated', 'Deprecated API', self.deprecated); - dom.tag('a', {href: 'http://github.com/angular/angular.js/edit/master/' + self.file, class: 'improve-docs btn btn-primary'}, 'Improve this doc'); + dom.tag('a', {href: 'http://github.com/angular/angular.js/edit/master/' + self.file, class: 'improve-docs btn btn-primary'}, function(dom) { + dom.tag('i', {class:'icon-edit'}, ' '); + dom.text(' Improve this doc'); + }); + if (self.section === 'api') { + dom.tag('a', {href: 'http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line, class: 'view-source btn btn-action'}, function(dom) { + dom.tag('i', {class:'icon-zoom-in'}, ' '); + dom.text(' View source'); + }); + } if (self.ngdoc != 'overview') { dom.h('Description', self.description, dom.html); } @@ -401,7 +410,7 @@ Doc.prototype = { ////////////////////////// function notice(name, legend, msg){ - if (self[name] == undefined) return; + if (self[name] === undefined) return; dom.tag('fieldset', {'class':name}, function(dom){ dom.tag('legend', legend); dom.text(msg); |
