Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(ngdocs): use cdn version to generate link to source files
Browse files Browse the repository at this point in the history
Closes #3616
Closes #3675
  • Loading branch information
jamesdaily authored and IgorMinar committed Aug 21, 2013
1 parent ffe1665 commit 5c4ffb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/spec/sourceLinkSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ describe('Docs Links', function() {
});

it('should have an "view source" button', function() {
spyOn(gruntUtil, 'getVersion').andReturn({cdn: '1.2.299'});

expect(doc.html()).
toContain('<a href="http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
toContain('<a href="http://github.com/angular/angular.js/tree/v1.2.299/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
});

});

});
2 changes: 1 addition & 1 deletion docs/src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Doc.prototype = {
if (this.section === 'api') {
dom.tag('a', {
href: 'http://github.com/angular/angular.js/tree/v' +
gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line,
gruntUtil.getVersion().cdn + '/' + self.file + '#L' + self.line,
class: 'view-source btn btn-action' }, function(dom) {
dom.tag('i', {class:'icon-zoom-in'}, ' ');
dom.text(' View source');
Expand Down

1 comment on commit 5c4ffb3

@revolunet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Please sign in to comment.