More fixes for canvas product type
This commit is contained in:
@@ -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,17 +18,24 @@ function ImageEditor(canvasId, args) {
|
|||||||
__type: _settings.type
|
__type: _settings.type
|
||||||
});
|
});
|
||||||
|
|
||||||
_canvas.getButtonMenu()
|
if (_canvas.__type === 'canvas') {
|
||||||
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
|
_canvas.getButtonMenu()
|
||||||
_canvas.getViewport().getGores().enable(this.isActive());
|
.addItem('3D', function () {})
|
||||||
})
|
.addItem('Flat', function () {})
|
||||||
.addItem(['Show Ruler', 'Hide Ruler'], function () {
|
.render();
|
||||||
_canvas.getViewport().getRulers().enable(this.isActive());
|
} else {
|
||||||
})
|
_canvas.getButtonMenu()
|
||||||
.addItem(['Fullscreen', 'Exit Fullscreen'], function () {
|
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
|
||||||
util.toggleFullscreen(_canvas.getSelectionElement().parentNode);
|
_canvas.getViewport().getGores().enable(this.isActive());
|
||||||
})
|
})
|
||||||
.render();
|
.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
|
* Crops image to desired dimensions
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user