Skip to content

Commit

Permalink
Merge pull request #804 from webgme/bug/802_meta_sheet_change_bug
Browse files Browse the repository at this point in the history
Fixes #802 Multiple Meta views in Split View changes the tabs unexpectedly.
  • Loading branch information
Patrik Meijer committed Jan 26, 2016
2 parents ebe453a + e84063a commit 77ed574
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions src/client/js/Panels/MetaEditor/MetaEditorControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ define(['js/logger',
this.diagramDesigner.clear();
};


/**********************************************************/
/* LOAD / UPDATE / UNLOAD HANDLER */
/**********************************************************/
Expand Down Expand Up @@ -202,7 +201,6 @@ define(['js/logger',
/* END OF --- LOAD / UPDATE / UNLOAD HANDLER */
/**********************************************************/


/**********************************************************/
/* CUSTOM BUTTON EVENT HANDLERS */
/**********************************************************/
Expand All @@ -213,7 +211,6 @@ define(['js/logger',
/* END OF --- CUSTOM BUTTON EVENT HANDLERS */
/**********************************************************/


/***********************************************************/
/* PROCESS CURRENT NODE TO HANDLE ADDED / REMOVED ELEMENT */
/***********************************************************/
Expand Down Expand Up @@ -308,7 +305,6 @@ define(['js/logger',
/* END OF --- PROCESS CURRENT NODE TO HANDLE ADDED / REMOVED ELEMENT */
/**********************************************************************/


/**************************************************************************/
/* HANDLE OBJECT LOAD --- DISPLAY IT WITH ALL THE POINTERS / SETS / ETC */
/**************************************************************************/
Expand Down Expand Up @@ -423,7 +419,6 @@ define(['js/logger',
/* END OF --- HANDLE OBJECT LOAD DISPLAY IT WITH ALL THE POINTERS / ... */
/**************************************************************************/


/****************************************************************************/
/* HANDLE OBJECT UNLOAD --- DISPLAY IT WITH ALL THE POINTERS / SETS / ETC */
/****************************************************************************/
Expand Down Expand Up @@ -547,7 +542,6 @@ define(['js/logger',
/* END OF --- HANDLE OBJECT UNLOAD */
/****************************************************************************/


/****************************************************************************/
/* CREATE A SPECIFIC TYPE OF CONNECTION BETWEEN 2 GME OBJECTS */
/****************************************************************************/
Expand Down Expand Up @@ -601,7 +595,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._saveConnectionToWaitingList = function (gmeSrcId, gmeDstId, connType, connTexts) {
if (this._GMENodes.indexOf(gmeSrcId) !== -1 && this._GMENodes.indexOf(gmeDstId) === -1) {
//#1 - the destination object is missing from the screen
Expand All @@ -624,7 +617,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._saveConnection = function (gmeSrcId, gmeDstId, connType, connComponentId, connTexts) {
//save by SRC
this._connectionListBySrcGMEID[gmeSrcId] = this._connectionListBySrcGMEID[gmeSrcId] || {};
Expand Down Expand Up @@ -661,7 +653,6 @@ define(['js/logger',
/* END OF --- CREATE A SPECIFIC TYPE OF CONNECTION BETWEEN 2 GME OBJECTS */
/****************************************************************************/


/****************************************************************************/
/* REMOVES A SPECIFIC TYPE OF CONNECTION FROM 2 GME OBJECTS */
/****************************************************************************/
Expand Down Expand Up @@ -720,7 +711,6 @@ define(['js/logger',
/* END OF --- REMOVES A SPECIFIC TYPE OF CONNECTION FROM 2 GME OBJECTS */
/****************************************************************************/


/*****************************************************************************/
/* UPDATE CONNECTION TEXT */
/*****************************************************************************/
Expand Down Expand Up @@ -828,7 +818,6 @@ define(['js/logger',
/* END OF --- HANDLE OBJECT UPDATE */
/**************************************************************************/


/***********************************************************************************/
/* DISPLAY META CONTAINMENT RELATIONS AS A CONNECTION FROM CONTAINER TO CONTAINED */
/***********************************************************************************/
Expand Down Expand Up @@ -905,7 +894,6 @@ define(['js/logger',
/* END OF --- DISPLAY META CONTAINMENT RELATIONS AS A CONNECTION FROM CONTAINER TO CONTAINED */
/**********************************************************************************************/


/*******************************************************************************/
/* DISPLAY META POINTER RELATIONS AS A CONNECTION FROM CONTAINER TO CONTAINED */
/*******************************************************************************/
Expand Down Expand Up @@ -938,7 +926,6 @@ define(['js/logger',
pointerMetaDescriptor = this._client.getValidTargetItems(gmeID, pointerNames[len]);
pointerOwnMetaTypes = this._client.getOwnValidTargetTypes(gmeID, pointerNames[len]);


if (pointerMetaDescriptor) {
lenTargets = pointerMetaDescriptor.length;
while (lenTargets--) {
Expand Down Expand Up @@ -1027,7 +1014,6 @@ define(['js/logger',
/* END OF --- DISPLAY META POINTER RELATIONS AS A CONNECTION FROM CONTAINER TO CONTAINED */
/******************************************************************************************/


/***********************************************************************************/
/* DISPLAY META INHERITANCE RELATIONS AS A CONNECTION FROM PARENT TO OBJECT */
/***********************************************************************************/
Expand All @@ -1053,7 +1039,6 @@ define(['js/logger',
/* END OF --- DISPLAY META CONTAINMENT RELATIONS AS A CONNECTION FROM PARENT TO OBJECT */
/**********************************************************************************************/


/****************************************************************************/
/* CREATE NEW CONNECTION BUTTONS AND THEIR EVENT HANDLERS */
/****************************************************************************/
Expand Down Expand Up @@ -1084,7 +1069,6 @@ define(['js/logger',
/* END OF --- CREATE NEW CONNECTION BUTTONS AND THEIR EVENT HANDLERS */
/****************************************************************************/


/****************************************************************************/
/* CREATE NEW CONNECTION BETWEEN TWO ITEMS */
/****************************************************************************/
Expand All @@ -1110,7 +1094,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._createContainmentRelationship = function (containerID, objectID) {
var containerNode = this._client.getNode(containerID),
objectNode = this._client.getNode(objectID);
Expand All @@ -1120,7 +1103,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._deleteContainmentRelationship = function (containerID, objectID) {
var containerNode = this._client.getNode(containerID),
objectNode = this._client.getNode(objectID);
Expand All @@ -1130,7 +1112,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._createPointerRelationship = function (sourceID, targetID, isSet) {
var sourceNode = this._client.getNode(sourceID),
targetNode = this._client.getNode(targetID),
Expand Down Expand Up @@ -1207,7 +1188,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._deletePointerRelationship = function (sourceID, targetID, pointerName, isSet) {
var sourceNode = this._client.getNode(sourceID),
targetNode = this._client.getNode(targetID),
Expand All @@ -1232,7 +1212,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._createInheritanceRelationship = function (objectID, newBaseID) {
var newBaseNode = this._client.getNode(newBaseID),
objectNode = this._client.getNode(objectID),
Expand All @@ -1252,7 +1231,6 @@ define(['js/logger',
}
};


MetaEditorControl.prototype._deleteInheritanceRelationship = function (parentID, objectID) {
var objectNode = this._client.getNode(objectID),
objectBaseId,
Expand Down Expand Up @@ -1281,7 +1259,6 @@ define(['js/logger',
/* END OF --- CREATE NEW CONNECTION BETWEEN TWO ITEMS */
/****************************************************************************/


/****************************************************************************/
/* POINTER FILTER PANEL AND EVENT HANDLERS */
/****************************************************************************/
Expand Down Expand Up @@ -1639,7 +1616,6 @@ define(['js/logger',

/************** END OF - CREATE META RELATION CONNECTION TYPES *****************/


/************** PRINT NODE DATA *****************/
// TODO removed, but could be reimplemented if needed such function
//this._btnPrintNodeMetaData = toolBar.addButton({ "title": "Print node META data",
Expand All @@ -1650,7 +1626,6 @@ define(['js/logger',
//this._toolbarItems.push(this._btnPrintNodeMetaData);
/************** END OF - PRINT NODE DATA *****************/


/****************** END OF - ADD BUTTONS AND THEIR EVENT HANDLERS TO DESIGNER CANVAS ******************/


Expand Down Expand Up @@ -1783,7 +1758,16 @@ define(['js/logger',
if (WebGMEGlobal.State.get(CONSTANTS.STATE_ACTIVE_TAB) !== null &&
WebGMEGlobal.State.get(CONSTANTS.STATE_ACTIVE_TAB) !== undefined &&
metaAspectSheetsRegistry.length > WebGMEGlobal.State.get(CONSTANTS.STATE_ACTIVE_TAB)) {
selectedSheetID = WebGMEGlobal.State.get(CONSTANTS.STATE_ACTIVE_TAB);
//only the active panel should react to the global state
if (WebGMEGlobal.PanelManager._activePanel === this) {
selectedSheetID = WebGMEGlobal.State.get(CONSTANTS.STATE_ACTIVE_TAB);
} else {
for (selectedSheetID in this._sheets || {}) {
if (this._sheets[selectedSheetID] === this._selectedMetaAspectSet) {
break;
}
}
}
}

if (!selectedSheetID) {
Expand All @@ -1799,7 +1783,6 @@ define(['js/logger',
return positionUpdated;
};


MetaEditorControl.prototype._initializeSelectedSheet = function () {
var len,
self = this;
Expand Down Expand Up @@ -1871,6 +1854,5 @@ define(['js/logger',
//attach MetaEditorControl - DiagramDesigner event handler functions
_.extend(MetaEditorControl.prototype, MetaEditorControlDiagramDesignerWidgetEventHandlers.prototype);


return MetaEditorControl;
});

0 comments on commit 77ed574

Please sign in to comment.