kopia lustrzana https://github.com/backface/turtlestitch
support dragging blocks out from table views
rodzic
58c1d98a58
commit
f5c330f404
|
@ -12,6 +12,7 @@
|
|||
|
||||
### 2022-01-23
|
||||
* morphic: added Node >> childThatIsA
|
||||
* tables: support dragging blocks out from table views
|
||||
|
||||
### 2022-01-22
|
||||
* blocks: support dragging blocks out from result bubbles
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<script src="src/paint.js?version=2021-07-05"></script>
|
||||
<script src="src/lists.js?version=2021-12-15"></script>
|
||||
<script src="src/byob.js?version=2022-01-07"></script>
|
||||
<script src="src/tables.js?version=2021-05-07"></script>
|
||||
<script src="src/tables.js?version=2022-01-23"></script>
|
||||
<script src="src/sketch.js?version=2021-11-03"></script>
|
||||
<script src="src/video.js?version=2019-06-27"></script>
|
||||
<script src="src/maps.js?version=2021-06-15"></script>
|
||||
|
|
|
@ -72,7 +72,7 @@ ListWatcherMorph, BoxMorph, Variable, isSnapObject, useBlurredShadows*/
|
|||
|
||||
/*jshint esversion: 6*/
|
||||
|
||||
modules.tables = '2021-July-05';
|
||||
modules.tables = '2022-January-23';
|
||||
|
||||
var Table;
|
||||
var TableCellMorph;
|
||||
|
@ -343,6 +343,7 @@ TableCellMorph.prototype.render = function (ctx) {
|
|||
x,
|
||||
y;
|
||||
|
||||
this.isDraggable = this.data instanceof Context;
|
||||
ctx.fillStyle = background;
|
||||
if (this.shouldBeList()) {
|
||||
BoxMorph.prototype.outlinePath.call(
|
||||
|
@ -475,6 +476,26 @@ TableCellMorph.prototype.mouseLeave = function () {
|
|||
}
|
||||
};
|
||||
|
||||
TableCellMorph.prototype.selectForEdit = function () {
|
||||
var script = this.data.toBlock(),
|
||||
prepare = script.prepareToBeGrabbed,
|
||||
ide = this.parentThatIsA(IDE_Morph) ||
|
||||
this.world().childThatIsA(IDE_Morph);
|
||||
|
||||
script.prepareToBeGrabbed = function (hand) {
|
||||
prepare.call(this, hand);
|
||||
hand.grabOrigin = {
|
||||
origin: ide.palette,
|
||||
position: ide.palette.center()
|
||||
};
|
||||
this.prepareToBeGrabbed = prepare;
|
||||
};
|
||||
|
||||
if (ide.isAppMode) {return; }
|
||||
script.setPosition(this.position());
|
||||
return script;
|
||||
};
|
||||
|
||||
// TableMorph //////////////////////////////////////////////////////////
|
||||
|
||||
// TableMorph inherits from FrameMorph:
|
||||
|
|
Ładowanie…
Reference in New Issue