Skip to content

Commit

Permalink
#91 rotated image fix and other typos
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Dec 9, 2017
1 parent 38b71d0 commit 5a052dc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
32 changes: 21 additions & 11 deletions www/js/EventCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ angular.module('zmApp.controllers')
var ratio;
var mw = parseInt(tempMon.Monitor.Width);
var mh = parseInt(tempMon.Monitor.Height);
var mo = Math.abs(parseInt(tempMon.Monitor.Orientation));
var mo =parseInt(tempMon.Monitor.Orientation);

myevents[i].Event.Rotation = '';

// scale by X if width > height
if (mw > mh ) {
Expand All @@ -443,10 +445,15 @@ angular.module('zmApp.controllers')

}

if (mo == 90) {
var t = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbWidth = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbHeight = t;
if (mo != 0) {
/*
myevents[i].Event.Rotation = {
'transform' : 'rotate('+mo+'deg'+')'
}; */

var tmp = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbHeight = myevents[i].Event.thumbWidth;
myevents[i].Event.thumbWidth = tmp;


} // swap
Expand Down Expand Up @@ -2968,7 +2975,7 @@ angular.module('zmApp.controllers')
var ratio;
var mw = parseInt(tempMon.Monitor.Width);
var mh = parseInt(tempMon.Monitor.Height);
var mo = Math.abs(parseInt(tempMon.Monitor.Orientation));
var mo = parseInt(tempMon.Monitor.Orientation);

// scale by X if width > height
if (mw > mh ) {
Expand All @@ -2983,13 +2990,16 @@ angular.module('zmApp.controllers')
myevents[i].Event.thumbWidth = Math.round(mw/ratio);

}
if (mo != 0) {

if (mo == 90) {
var t = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbWidth = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbHeight = t;

/*myevents[i].Event.Rotation = {
'transform' : 'rotate('+mo+'deg'+')'
}; */

var tmp = myevents[i].Event.thumbHeight;
myevents[i].Event.thumbHeight = myevents[i].Event.thumbWidth;
myevents[i].Event.thumbWidth = tmp;

} // swap
}

Expand Down
9 changes: 5 additions & 4 deletions www/templates/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="col">
<div class="item-text-wrap">

<b><i ng-if="event.Event.Archived=='1'" class="ion-ios-flag" style="color:red">&nbsp;</i>{{event.Event.MonitorName}}</b> <span ng-if"!loginData.enableThumbs || !event.Event.MaxScore">({{event.Event.Id}})</span> &nbsp;
<b><i ng-if="event.Event.Archived=='1'" class="ion-ios-flag" style="color:red">&nbsp;</i>{{event.Event.MonitorName}}</b> <span ng-if="!loginData.enableThumbs &&event.Event.MaxScoreFrameId">({{event.Event.Id}})</span> &nbsp;
<button ng-if="gifshotSupported && loginData.enableGIFMP4 " class="button button-small button-clear icon gif-icon" ng-click="permissionsDownload(event)">
</button>

Expand All @@ -85,11 +85,12 @@

</div>

<div ng-if="loginData.enableThumbs && event.Event.MaxScore" class = "col col-left">
<div ng-if="loginData.enableThumbs && event.Event.MaxScoreFrameId" class = "col col-left" style="max-height:150px" >
<!-- thumbnail -->

<!-- ng-image-appear transition-duration="0.5s" animation="fillIn" bg-color="#50a4e2" -->
<img ng-image-appear transition-duration="0.3s" animation="fillIn" bg-color="#50a4e2" width="{{event.Event.thumbWidth}}px" height="{{event.Event.thumbHeight}}px" ng-src="{{event.Event.baseURL}}/index.php?view=image&fid={{event.Event.MaxScoreFrameId}}&width={{event.Event.thumbWidth*2}}&height={{event.Event.thumbHeight*2}}" on-tap="showThumbnail(event.Event.baseURL,event.Event.MaxScoreFrameId)" />
<!-- ng-image-appear transition-duration="0.5s" animation="fillIn" bg-color="#50a4e2" {{event.Event.thumbWidth}}X{{event.Event.thumbHeight}}-->

<img ng-image-appear transition-duration="0.3s" animation="fillIn" bg-color="#50a4e2" width="{{event.Event.thumbWidth}}px" height="{{event.Event.thumbHeight}}px" ng-src="{{event.Event.baseURL}}/index.php?view=image&fid={{event.Event.MaxScoreFrameId}}&width={{event.Event.thumbWidth*2}}&height={{event.Event.thumbHeight*2}}" on-tap="showThumbnail(event.Event.baseURL,event.Event.MaxScoreFrameId)" />
<!--<p>{{event.Event.thumbWidth}}px*{{event.Event.thumbHeight}}px</p>-->


Expand Down

0 comments on commit 5a052dc

Please sign in to comment.