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} * @return {FrameHandler}
*/ */
this.setFrames = function (frameType) { this.setFrames = function (frameType) {
frameType = frameType || _frameType;
_frameType = frameType;
if (!frameType) {
return;
}
if (frameType === 'none') { if (frameType === 'none') {
return this.setVisible(false); return this.setVisible(false);
} }
_frameType = frameType; this.setVisible(true);
_frames.top.height = _frames.top.height =
_frames.bottom.height = _frames.bottom.height =
@@ -18,6 +18,12 @@ function ImageEditor(canvasId, args) {
__type: _settings.type __type: _settings.type
}); });
if (_canvas.__type === 'canvas') {
_canvas.getButtonMenu()
.addItem('3D', function () {})
.addItem('Flat', function () {})
.render();
} else {
_canvas.getButtonMenu() _canvas.getButtonMenu()
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () { .addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
_canvas.getViewport().getGores().enable(this.isActive()); _canvas.getViewport().getGores().enable(this.isActive());
@@ -29,6 +35,7 @@ function ImageEditor(canvasId, args) {
util.toggleFullscreen(_canvas.getSelectionElement().parentNode); util.toggleFullscreen(_canvas.getSelectionElement().parentNode);
}) })
.render(); .render();
}
/** /**
* Crops image to desired dimensions * Crops image to desired dimensions
+3 -2
View File
@@ -10,6 +10,7 @@ function Viewport(canvas) {
var _borderWidth = 2; var _borderWidth = 2;
var _data = null; var _data = null;
var _rect; var _rect;
var self = this;
/** /**
* Applies viewport to page * Applies viewport to page
@@ -42,7 +43,7 @@ function Viewport(canvas) {
} }
canvas.getDragbars().apply(); canvas.getDragbars().apply();
self.setFrame();
// Apertures sometimes overlaps the viewports bounding rect. // Apertures sometimes overlaps the viewports bounding rect.
// Solve this by bringing it to the front after apertures are applied. // Solve this by bringing it to the front after apertures are applied.
_rect.bringToFront(); _rect.bringToFront();
@@ -136,7 +137,7 @@ function Viewport(canvas) {
*/ */
this.setFrame = function (frameType) { this.setFrame = function (frameType) {
this.getFrameHandler().setFrames(frameType); this.getFrameHandler().setFrames(frameType);
} };
this.getData = function () { this.getData = function () {
return _data; return _data;