You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/08/07 06:06:10 UTC
openmeetings git commit: [OPENMEETINGS-1642] local fullFit basically
implemented
Repository: openmeetings
Updated Branches:
refs/heads/master d21b9ec01 -> cb3b99162
[OPENMEETINGS-1642] local fullFit basically implemented
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/cb3b9916
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/cb3b9916
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/cb3b9916
Branch: refs/heads/master
Commit: cb3b99162d1f8f33431914bbd575ecbfb8243e48
Parents: d21b9ec
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Mon Aug 7 13:06:02 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Mon Aug 7 13:06:02 2017 +0700
----------------------------------------------------------------------
.../openmeetings/web/room/wb/WbPanel.html | 2 +-
.../org/apache/openmeetings/web/room/wb/wb.js | 31 +++++++++++++-------
2 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/cb3b9916/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
index 77bca40..3cdc08f 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
@@ -71,7 +71,7 @@
<button type="button" class="btn btn-default zoom-out" wicket:message="title:259"><span class="ui-icon ui-icon-minusthick"></span></button>
<button type="button" class="btn btn-default zoom-in" wicket:message="title:260"><span class="ui-icon ui-icon-plusthick"></span></button>
</div>
- <select class="zoom">
+ <select class="zoom" data-custom-val="1.20">
<option value="full-fit"><wicket:message key="847"/></option>
<option value="custom">120%</option>
<option value="0.50">50%</option>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/cb3b9916/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
index add05d2..7102df5 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
@@ -749,19 +749,26 @@ var Wb = function() {
_updateZoomPanel();
z.find('.zoom-out').click(function() {
wb.zoom -= .2;
+ wb.fullFit = false;
_setSize();
});
z.find('.zoom-in').click(function() {
wb.zoom += .2;
+ wb.fullFit = false;
_setSize();
});
z.find('.zoom').change(function() {
var zzz = $(this).val();
+ wb.fullFit = false;
if (isNaN(zzz)) {
- if ('custom' === zzz) {
- wb.zoom = $(this).data('val');
+ switch (zzz) {
+ case 'full-fit':
+ wb.fullFit = true;
+ break;
+ case 'custom':
+ wb.zoom = $(this).data('custom-val');
+ break;
}
- //TODO handle custom, full-fit
} else {
wb.zoom = 1. * zzz;
}
@@ -1016,15 +1023,17 @@ var Wb = function() {
setHandlers(canvas);
}
function _setSize() {
- //TODO fullFit
- var oo = z.find('.zoom').find('option[value="' + wb.zoom.toFixed(2) + '"]');
- if (oo.length == 1) {
- oo.prop('selected', true);
+ if (wb.fullFit) {
+ wb.zoom = (a.width() - 10) / wb.width;
} else {
- z.find('.zoom').find('option[value=custom]')
- .text(100. * wb.zoom.toFixed(2) + '%')
- .data('val', wb.zoom)
- .prop('selected', true);
+ var oo = z.find('.zoom').find('option[value="' + wb.zoom.toFixed(2) + '"]');
+ if (oo.length == 1) {
+ oo.prop('selected', true);
+ } else {
+ z.find('.zoom').data('custom-val', wb.zoom).find('option[value=custom]')
+ .text(100. * wb.zoom.toFixed(2) + '%')
+ .prop('selected', true);
+ }
}
wb.eachCanvas(function(canvas) {
canvas.setWidth(wb.zoom * wb.width).setHeight(wb.zoom * wb.height).setZoom(wb.zoom);