Skip to content

Commit 2e74aec

Browse files
committed
ATT-1:Enable rotation of image attachments, adding the javascript code and enabling the java code to call 'rotate instruction
1 parent 1ab881a commit 2e74aec

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

api/src/main/java/org/openmrs/module/attachments/obs/ImageAttachmentHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ protected boolean deleteComplexData(Obs obs, AttachmentComplexData complexData)
7070

7171
@Override
7272
protected ValueComplex saveComplexData(Obs obs, AttachmentComplexData complexData) {
73+
if (obs.getValueModifier().equals("instructions.rotate-right")) {
74+
// rotate the image provided in complex data
75+
}
76+
obs.setValueModifier(null);
77+
7378
int imageHeight = Integer.MAX_VALUE;
7479
int imageWidth = Integer.MAX_VALUE;
7580

omod/src/main/webapp/resources/scripts/directives/thumbnail.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ angular.module('att.widget.thumbnail')
125125
uuid: $scope.obs.uuid,
126126
comment: $scope.obs.comment
127127
});
128+
Attachment.save({
129+
uuid: $scope.obs.uuid,
130+
valueModifier: "instructions.rotate-right"
131+
});
128132
saved.$promise.then(function(attachment) {
129133
$scope.obs.uuid = attachment.uuid;
130134
$scope.toggleEditMode(false);
@@ -278,4 +282,4 @@ angular.module('att.widget.thumbnail')
278282
}
279283
}
280284
};
281-
}]);
285+
}]);

0 commit comments

Comments
 (0)