More fixes for canvas product type

This commit is contained in:
Rikard Bartholf
2017-05-16 12:20:52 +02:00
parent 578c44ebfd
commit e8d6e5de34
3 changed files with 29 additions and 14 deletions
@@ -54,11 +54,18 @@ function FrameHandler(viewport) {
* @return {FrameHandler}
*/
this.setFrames = function (frameType) {
frameType = frameType || _frameType;
_frameType = frameType;
if (!frameType) {
return;
}
if (frameType === 'none') {
return this.setVisible(false);
}
_frameType = frameType;
this.setVisible(true);
_frames.top.height =
_frames.bottom.height =
+18 -11
View File
@@ -18,17 +18,24 @@ function ImageEditor(canvasId, args) {
__type: _settings.type
});
_canvas.getButtonMenu()
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
_canvas.getViewport().getGores().enable(this.isActive());
})
.addItem(['Show Ruler', 'Hide Ruler'], function () {
_canvas.getViewport().getRulers().enable(this.isActive());
})
.addItem(['Fullscreen', 'Exit Fullscreen'], function () {
util.toggleFullscreen(_canvas.getSelectionElement().parentNode);
})
.render();
if (_canvas.__type === 'canvas') {
_canvas.getButtonMenu()
.addItem('3D', function () {})
.addItem('Flat', function () {})
.render();
} else {
_canvas.getButtonMenu()
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
_canvas.getViewport().getGores().enable(this.isActive());
})
.addItem(['Show Ruler', 'Hide Ruler'], function () {
_canvas.getViewport().getRulers().enable(this.isActive());
})
.addItem(['Fullscreen', 'Exit Fullscreen'], function () {
util.toggleFullscreen(_canvas.getSelectionElement().parentNode);
})
.render();
}
/**
* Crops image to desired dimensions
+3 -2
View File
@@ -10,6 +10,7 @@ function Viewport(canvas) {
var _borderWidth = 2;
var _data = null;
var _rect;
var self = this;
/**
* Applies viewport to page
@@ -42,7 +43,7 @@ function Viewport(canvas) {
}
canvas.getDragbars().apply();
self.setFrame();
// Apertures sometimes overlaps the viewports bounding rect.
// Solve this by bringing it to the front after apertures are applied.
_rect.bringToFront();
@@ -136,7 +137,7 @@ function Viewport(canvas) {
*/
this.setFrame = function (frameType) {
this.getFrameHandler().setFrames(frameType);
}
};
this.getData = function () {
return _data;