Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
========================
:bug: Fixes #782 - Project info corruption
:bug: Fixes #782 - Navigation produce file corruption
:sparkles: Fixes #780 - Improve in wire routing
:ambulance: Fixes #779 - Fix loading errors

Files to be committed:
======================
:pencil: app/scripts/controllers/design.js
:pencil: app/scripts/controllers/menu.js
:pencil: app/scripts/services/graph.js
:pencil: app/scripts/services/utils.js
  • Loading branch information
cavearr committed Nov 10, 2024
1 parent 276d524 commit a59cf1b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
34 changes: 26 additions & 8 deletions app/scripts/controllers/design.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ angular

do {
graph.breadcrumbs.pop();
common.submoduleHeap.pop();
item = graph.breadcrumbs.slice(-1)[0];
}
while (selectedItem !== item);
if(common.submoduleHeap.length>0){
const last=common.submoduleHeap.length - 1;
common.submoduleId=common.submoduleHeap[last].id;
common.submoduleUID=common.submoduleHeap[last].uid;
}

loadSelectedGraph();
}
}
Expand All @@ -67,8 +74,13 @@ angular
if (!$scope.isNavigating) {
$scope.isNavigating = true;
graph.breadcrumbs.pop();

loadSelectedGraph();
common.submoduleHeap.pop();
if(common.submoduleHeap.length>0){
const last=common.submoduleHeap.length - 1;
common.submoduleId=common.submoduleHeap[last].id;
common.submoduleUID=common.submoduleHeap[last].uid;
}
loadSelectedGraph();
}
};

Expand Down Expand Up @@ -112,7 +124,6 @@ angular
tmp = utils.clone(common.allDependencies[block.type]);
tmp.design.graph = p.design.graph;
/*var hId = utils.dependencyID(tmp);*/

var hId = block.type;
common.allDependencies[hId] = tmp;
$scope.toRestore = hId;
Expand Down Expand Up @@ -152,7 +163,6 @@ angular
var design = false;
var i = 0;
if (n === 1) {

design = project.get('design');
opt.disabled = false;
if ($scope.toRestore !== false &&
Expand Down Expand Up @@ -190,7 +200,6 @@ angular
}
$scope.toRestore = false;
}

graph.fitContent();
graph.resetView();
graph.loadDesign(dependency.design, opt, function () {
Expand All @@ -203,21 +212,30 @@ angular

$rootScope.$on('navigateProject', function (event, args) {
var opt = { disabled: true };
if(typeof common.submoduleHeap === 'undefined'){
common.submoduleHeap=[];
}
let heap={id:false,uid:false};
if (typeof args.submodule !== 'undefined') {

common.submoduleId = args.submodule;

heap.id=args.submodule;
}
if (typeof args.submoduleId !== 'undefined') {

common.submoduleUID = args.submoduleId;

heap.uid=args.submoduleId;
}

if(heap.id !== false || heap.uid !== false) {
common.submoduleHeap.push(heap);
}

if (typeof args.editMode !== 'undefined') {

opt.disabled = args.editMode;
}

if (args.update) {
graph.resetView();
project.update({ deps: false }, function () {
Expand Down Expand Up @@ -257,4 +275,4 @@ angular

});

});
});
1 change: 1 addition & 0 deletions app/scripts/controllers/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@ angular

function getProjectInformation() {
var p = false;
console.log('INFO:',subModuleActive,common);
if (
subModuleActive &&
typeof common.submoduleId !== "undefined" &&
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/services/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ angular.module('icestudio')
between modules, we fix with the new engine , meanwhile this works --*/
let _this=this;
$('body').on('Graph::updateWires',function(){
// setTimeout(function(){
setTimeout(function(){
_this.updateWires();
// },2000);
},100);
});

//-- ZOOM constants
Expand Down
6 changes: 4 additions & 2 deletions app/scripts/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1525,8 +1525,10 @@ angular.module('icestudio')
this.endBlockingTask = function () {

$('body').trigger('Graph::updateWires');
angular.element('#menu').removeClass('is-disabled');
$('body').removeClass('waiting');
setTimeout(function(){
angular.element('#menu').removeClass('is-disabled');
$('body').removeClass('waiting');
},750);
};

this.isFunction = function (functionToCheck) {
Expand Down

0 comments on commit a59cf1b

Please sign in to comment.