Skip to content

Commit

Permalink
example completed
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanee committed Jan 15, 2014
1 parent 929d4a2 commit ff33a7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 2 additions & 4 deletions example/js/directives/angular-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
templateUrl: function(element, attr) {
return attr.templateUrl ? attr.templateUrl : 'partials/viewer.html'
},
link: function (scope) {
link: function (scope, element, attrs) {
var url = scope.pdfUrl,
pdfDoc = null,
pageNum = 1,
Expand All @@ -19,9 +19,7 @@

windowEl.on('scroll', function() {
scope.$apply(function() {
scope.scroll = windowEl.scrollTop();
console.log('helloooooooooo')
console.log(scope.sroll);
scope.scroll = windowEl[0].scrollY;
});
});

Expand Down
3 changes: 2 additions & 1 deletion example/partials/viewer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav ng-class="{'pdf-controls fixed': scroll > 100}">
<nav ng-class="{'pdf-controls fixed': scroll > 100, 'pdf-controls': scroll <= 100}">
<button ng-click="goPrevious()"><</span></button>
<button ng-click="goNext()">></span></button>

Expand All @@ -10,6 +10,7 @@
<span>Page: </span>
<input type="tel" class="form-control" min=1 ng-model="pageNum">
<span> / {{pageCount}}</span>

</nav>

<hr>
Expand Down
5 changes: 3 additions & 2 deletions example/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*{box-sizing: border-box;}
.wrapper {margin: 0 auto; width: 960px; }
.pdf-controls { width: 100%; display: block;}
.pdf-controls { width: 100%; display: block; background: #eee; padding: 1em;}
.rotate0 {-webkit-transform: rotate(0deg); transform: rotate(0deg); }
.rotate90 {-webkit-transform: rotate(90deg); transform: rotate(90deg); }
.rotate180 {-webkit-transform: rotate(180deg); transform: rotate(180deg); }
.rotate270 {-webkit-transform: rotate(270deg); transform: rotate(270deg); }
.fixed {position: fixed; top: 0; left: 0; z-index: 100; width: 100% }
.fixed { position: fixed; top: 0; left: calc(50% - 480px); z-index: 100; width: 100%; padding: 1em; background: rgba(238, 238, 238,.9); width: 960px; }

0 comments on commit ff33a7a

Please sign in to comment.