|
@@ -2,15 +2,52 @@ import Tool from '../Systems/Tool';
|
|
|
import { View , Text , Button , TextInput , StyleSheet} from 'react-native';
|
|
|
import { Icon } from 'react-native-elements'
|
|
|
import React from 'react';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+import Library from 'trapilib/dist/lib';
|
|
|
+
|
|
|
+let {
|
|
|
+ CoreSystem,
|
|
|
+ ViewSystem,
|
|
|
+ ViewNode,
|
|
|
+ Node
|
|
|
+} = Library;
|
|
|
export default class Add extends Tool{
|
|
|
constructor(){
|
|
|
super()
|
|
|
+ this.selectedNode = null;
|
|
|
}
|
|
|
|
|
|
|
|
|
- editViewNode(node){
|
|
|
- console.log("I have the node here now i can manipulate the Dom by addind")
|
|
|
- console.log(node)
|
|
|
+ editViewNode(CS,node){
|
|
|
+ if(!node) return;
|
|
|
+
|
|
|
+ if( this.selectedNode ) {
|
|
|
+ this.selectedNode.props.selected = false;
|
|
|
+
|
|
|
+ }
|
|
|
+ node.props = {
|
|
|
+ ...node.props,
|
|
|
+ selected: true
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectedNode = node;
|
|
|
+ let viewName = CS.Routing.getCurrentView();
|
|
|
+ let View = CS.ViewSystem.getView(viewName);
|
|
|
+ let rows = View.getRows(this.selectedNode);
|
|
|
+ View.setRows(this.selectedNode,rows.length + 1)
|
|
|
+ rows = View.getRows(this.selectedNode)
|
|
|
+
|
|
|
+ console.log(rows[rows.length-1])
|
|
|
+
|
|
|
+ View.setColumns(rows[rows.length-1],1)
|
|
|
+ rows[rows.length-1].props.selected = true;
|
|
|
+/*
|
|
|
+ rows.forEach((row) => {
|
|
|
+ View.setColumns(row,1);
|
|
|
+ row.props.selected = true})
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
|