|
@@ -32,6 +32,9 @@ class Cell extends Component {
|
|
|
if(!visible)
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ // Used to get the Cell component back from its DOM/Jquery element
|
|
|
+ root.prop("cellComp", this);
|
|
|
if( column.kind == Script ) root.addClass("t_script");
|
|
|
refresh();
|
|
|
switch( column.type ) {
|
|
@@ -41,21 +44,6 @@ class Cell extends Component {
|
|
|
e.stopPropagation();
|
|
|
@:privateAccess line.table.toggleList(this);
|
|
|
});
|
|
|
- case TFile:
|
|
|
- if (canEdit()) {
|
|
|
- element.on("drop", function(e : js.jquery.Event) {
|
|
|
- var e : js.html.DragEvent = untyped e.originalEvent;
|
|
|
- if (e.dataTransfer.files.length > 0) {
|
|
|
- e.preventDefault();
|
|
|
- e.stopPropagation();
|
|
|
- setValue(ide.makeRelative(untyped e.dataTransfer.files.item(0).path));
|
|
|
- refresh();
|
|
|
- }
|
|
|
- });
|
|
|
- element.dblclick(function(_) edit());
|
|
|
- } else {
|
|
|
- root.addClass("t_readonly");
|
|
|
- }
|
|
|
case TString if( column.kind == Script ):
|
|
|
element.click(function(_) edit());
|
|
|
default:
|
|
@@ -76,6 +64,15 @@ class Cell extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ public function dragDropFile( relativePath : String, isDrop : Bool = false ) : Bool {
|
|
|
+ if ( !canEdit() || column.type != TFile) return false;
|
|
|
+ if ( isDrop ) {
|
|
|
+ setValue(relativePath);
|
|
|
+ refresh();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
function evaluate() {
|
|
|
var f = editor.formulas.get(this);
|
|
|
if( f == null ) return;
|