Bladeren bron

Merge branch 'improveLog' of ssh://git.lcalion.com:2245/LInE/ivprog into improveLog

Lucas de Souza 5 jaren geleden
bovenliggende
commit
6f2faa5461
2 gewijzigde bestanden met toevoegingen van 15 en 0 verwijderingen
  1. 3 0
      js/visualUI/commands.js
  2. 12 0
      js/visualUI/functions.js

+ 3 - 0
js/visualUI/commands.js

@@ -19,6 +19,9 @@ import { registerUserEvent, ActionTypes } from "./../services/userLog";
 // let which_element_is_draged = null;
 
 export function removeCommand (command, function_obj, dom_obj) {
+
+	registerUserEvent(function_obj.name, ActionTypes.REMOVE_COMMAND, command.type, '/', 0);
+
 	if (function_obj.commands.indexOf(command) > -1) {
 		function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
 		return true;

+ 12 - 0
js/visualUI/functions.js

@@ -633,6 +633,18 @@ function addSortableHandler (element, id_function) {
     animation: 300,
     group: {name: n_group},
     onEnd: function (evt) {
+
+      var nodes = Array.prototype.slice.call( $('.all_functions').children() );
+      var function_index;
+      var function_obj;
+      $(evt.item).parentsUntil(".all_functions").each(function (index) {
+        if ($(this).hasClass('function_div')) {
+          function_index = nodes.indexOf(this);
+          function_obj = window.program_obj.functions[function_index];
+        }
+      });
+
+       registerUserEvent(function_obj.name, ActionTypes.MOVE_COMMAND, $(evt.item).data('command').type, '/', 'from: ' + evt.oldIndex + ' to: ' + evt.newIndex);
        //updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
        var itemEl = evt.item;  // dragged HTMLElement
        evt.to;    // target list