document simplification; document image size fixed;

This commit is contained in:
tmshv committed 2015-03-01 16:55:08 +03:00
1 parent d892105e9f
commit ba2891d09b
4 files changed
+30 -66

No files matched your search

+28 -41
View File
@@ -8,46 +8,33 @@ module.exports = function (app) {
var doc_uri = $location.$$path.replace("/document/", ""); var doc_uri = $location.$$path.replace("/document/", "");
$scope.document = docs.doc(doc_uri); $scope.document = docs.doc(doc_uri);
$scope.document.currentPage = 0; //$scope.document.currentPage = 0;
//
$scope.viewDocument = function () { //$scope.totalPages = $scope.document.url.length;
return "/views/document-image.html"; //$scope.currentPage = 1;
switch ($scope.document.viewer) { //
case "img-sheet": //$scope.prevPage = function () {
$scope.showControls = false; // var i = $scope.currentPage - 1;
return "/views/document-image.html"; // if (i > 0) {
// $scope.currentPage = i;
default: // $scope.document.currentPage = i - 1;
$scope.showControls = true; // }
return "/views/document-paper.html"; //};
} //
}; //$scope.nextPage = function () {
// var i = $scope.currentPage + 1;
$scope.totalPages = $scope.document.url.length; // if (i <= $scope.totalPages) {
$scope.currentPage = 1; // $scope.currentPage = i;
// $scope.document.currentPage = i - 1;
$scope.prevPage = function () { // }
var i = $scope.currentPage - 1; //};
if (i > 0) { //
$scope.currentPage = i; //$scope.update = function () {
$scope.document.currentPage = i - 1; // var i = $scope.currentPage;
} // if (i > 0 && i <= $scope.totalPages) {
}; // $scope.currentPage = i;
// $scope.document.currentPage = i - 1;
$scope.nextPage = function () { // }
var i = $scope.currentPage + 1; //};
if (i <= $scope.totalPages) {
$scope.currentPage = i;
$scope.document.currentPage = i - 1;
}
};
$scope.update = function () {
var i = $scope.currentPage;
if (i > 0 && i <= $scope.totalPages) {
$scope.currentPage = i;
$scope.document.currentPage = i - 1;
}
};
}); });
}; };
+2 -23
View File
@@ -10,7 +10,6 @@
<script src="/bower_components/jquery/dist/jquery.min.js"></script> <script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/angular/angular.min.js"></script> <script src="/bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-route/angular-route.min.js"></script> <script src="/bower_components/angular-route/angular-route.min.js"></script>
<script src="/bower_components/angular-animate/angular-animate.min.js"></script>
<script src="data.js"></script> <script src="data.js"></script>
<script src="document.js"></script> <script src="document.js"></script>
</head> </head>
@@ -25,30 +24,10 @@
<span class="norm">{{document.title}}</span> <span class="norm">{{document.title}}</span>
</h1> </h1>
</div> </div>
<div class="panel right">
<div class="controls" ng-show="showControls">
<p class="block">
<span>Страница</span>
<input ng-model="currentPage" ng-change="update()" type="text" pattern="[0-9]{,3}">
из
<span>{{totalPages}}</span>
</p>
<p class="block">
<button ng-click="prevPage()">←</button>
<button ng-click="nextPage()">→</button>
</p>
<p class="block">
<a class="download" href="{{document.download}}"></a>
</p>
</div>
</div>
</div> </div>
<div class="document"> <div class="document doclist">
<div class="page {{pageClass}}" ng-include="viewDocument()"></div> <img ng-src="{{url}}" alt="" ng-repeat="url in document.files"/>
</div> </div>
</div> </div>
-1
View File
@@ -1 +0,0 @@
<img ng-src="{{url}}" alt="" ng-repeat="url in document.files"/>
-1
View File
@@ -1 +0,0 @@
<pdf document="document"></pdf>