mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fixed layout issue when hovering on non 32x32 tile previews
This commit is contained in:
parent
29a44b79c5
commit
019df61cdc
@ -39,8 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.preview-tile .tile-action {
|
.preview-tile .tile-action {
|
||||||
display: none;
|
display: block;
|
||||||
float: right;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@ -50,8 +49,14 @@
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-tile:hover .tile-action {
|
.preview-tile .tile-action-container {
|
||||||
display: block;
|
float: right;
|
||||||
|
visibility : hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-tile:hover .tile-action-container {
|
||||||
|
visibility : visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-tile .tile-action.duplicate-frame-action {
|
.preview-tile .tile-action.duplicate-frame-action {
|
||||||
|
@ -181,11 +181,15 @@
|
|||||||
|
|
||||||
previewTileRoot.addEventListener('click', this.onPreviewClick_.bind(this, tileNumber));
|
previewTileRoot.addEventListener('click', this.onPreviewClick_.bind(this, tileNumber));
|
||||||
|
|
||||||
|
var actionContainer = document.createElement("DIV");
|
||||||
|
actionContainer.className = "tile-action-container";
|
||||||
|
|
||||||
var canvasPreviewDuplicateAction = document.createElement("button");
|
var canvasPreviewDuplicateAction = document.createElement("button");
|
||||||
canvasPreviewDuplicateAction.setAttribute('rel', 'tooltip');
|
canvasPreviewDuplicateAction.setAttribute('rel', 'tooltip');
|
||||||
canvasPreviewDuplicateAction.setAttribute('data-placement', 'right');
|
canvasPreviewDuplicateAction.setAttribute('data-placement', 'right');
|
||||||
canvasPreviewDuplicateAction.setAttribute('title', 'Duplicate this frame');
|
canvasPreviewDuplicateAction.setAttribute('title', 'Duplicate this frame');
|
||||||
canvasPreviewDuplicateAction.className = "tile-action duplicate-frame-action"
|
canvasPreviewDuplicateAction.className = "tile-action duplicate-frame-action";
|
||||||
|
actionContainer.appendChild(canvasPreviewDuplicateAction);
|
||||||
|
|
||||||
canvasPreviewDuplicateAction.addEventListener('click', this.onAddButtonClick_.bind(this, tileNumber));
|
canvasPreviewDuplicateAction.addEventListener('click', this.onAddButtonClick_.bind(this, tileNumber));
|
||||||
|
|
||||||
@ -196,7 +200,6 @@
|
|||||||
currentFrameRenderer.init(currentFrame);
|
currentFrameRenderer.init(currentFrame);
|
||||||
|
|
||||||
previewTileRoot.appendChild(canvasContainer);
|
previewTileRoot.appendChild(canvasContainer);
|
||||||
previewTileRoot.appendChild(canvasPreviewDuplicateAction);
|
|
||||||
|
|
||||||
if(tileNumber > 0 || this.framesheet.getFrameCount() > 1) {
|
if(tileNumber > 0 || this.framesheet.getFrameCount() > 1) {
|
||||||
var canvasPreviewDeleteAction = document.createElement("button");
|
var canvasPreviewDeleteAction = document.createElement("button");
|
||||||
@ -206,8 +209,11 @@
|
|||||||
canvasPreviewDeleteAction.className = "tile-action delete-frame-action"
|
canvasPreviewDeleteAction.className = "tile-action delete-frame-action"
|
||||||
canvasPreviewDeleteAction.addEventListener('click', this.onDeleteButtonClick_.bind(this, tileNumber));
|
canvasPreviewDeleteAction.addEventListener('click', this.onDeleteButtonClick_.bind(this, tileNumber));
|
||||||
previewTileRoot.appendChild(canvasPreviewDeleteAction);
|
previewTileRoot.appendChild(canvasPreviewDeleteAction);
|
||||||
|
actionContainer.appendChild(canvasPreviewDeleteAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
previewTileRoot.appendChild(actionContainer);
|
||||||
|
|
||||||
return previewTileRoot;
|
return previewTileRoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user