- new shortcut alt + N for system renaming, closed #790
This commit is contained in:
@@ -43,6 +43,11 @@ define([
|
||||
keyNames: ['CONTROL', 'V'],
|
||||
alias: 'paste'
|
||||
},
|
||||
renameSystem: {
|
||||
group: 'map',
|
||||
label: 'Rename system',
|
||||
keyNames: ['ALT', 'N']
|
||||
},
|
||||
newSignature: {
|
||||
group: 'signatures',
|
||||
label: 'New Signature',
|
||||
|
||||
@@ -3176,7 +3176,7 @@ define([
|
||||
},
|
||||
onScrollStart: function(){
|
||||
// hide all open xEditable fields
|
||||
$(this).find('.editable').editable('hide');
|
||||
$(this).find('.editable.editable-open').editable('hide');
|
||||
|
||||
// hide all system head tooltips
|
||||
$(this).find('.' + config.systemHeadClass + ' .fa').tooltip('hide');
|
||||
|
||||
@@ -85,10 +85,11 @@ define([
|
||||
* -> subtract some offset for tooltips/connections
|
||||
* @param scrollWrapper
|
||||
* @param position
|
||||
* @param options
|
||||
*/
|
||||
let scrollToSystem = (scrollWrapper, position) => {
|
||||
let scrollToSystem = (scrollWrapper, position, options) => {
|
||||
position = getOffsetPosition(position, {x: -15, y: -35});
|
||||
scrollToPosition(scrollWrapper, position);
|
||||
scrollToPosition(scrollWrapper, position, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -778,6 +778,14 @@ define([
|
||||
return zoomChange;
|
||||
};
|
||||
|
||||
/**
|
||||
* toggles editable input form for system rename (set alias)
|
||||
* @param system
|
||||
*/
|
||||
let toggleSystemAliasEditable = system => {
|
||||
system.find('.editable').editable('toggle');
|
||||
};
|
||||
|
||||
/**
|
||||
* mark system as "selected" e.g. for dragging
|
||||
* @param map
|
||||
@@ -1999,6 +2007,7 @@ define([
|
||||
filterMapByScopes: filterMapByScopes,
|
||||
changeZoom: changeZoom,
|
||||
setZoom: setZoom,
|
||||
toggleSystemAliasEditable: toggleSystemAliasEditable,
|
||||
storeLocaleCharacterData: storeLocaleCharacterData,
|
||||
getLocaleData: getLocaleData,
|
||||
storeLocalData: storeLocalData,
|
||||
|
||||
@@ -119,11 +119,21 @@ define([
|
||||
return this.each((i, body) => {
|
||||
body = $(body);
|
||||
|
||||
body.watchKey('tabReload', (body) => {
|
||||
body.watchKey('tabReload', body => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
body.watchKey('newSignature', (body) => {
|
||||
body.watchKey('renameSystem', body => {
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
let activeSystem = activeMap.find('.' + MapUtil.config.systemActiveClass + ':first');
|
||||
if(activeSystem.length){
|
||||
MapUtil.toggleSystemAliasEditable(activeSystem);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
body.watchKey('newSignature', body => {
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
let mapContentElement = MapUtil.getTabContentElementByMapElement(activeMap);
|
||||
@@ -132,7 +142,7 @@ define([
|
||||
}
|
||||
});
|
||||
|
||||
body.watchKey('clipboardPaste', (e) => {
|
||||
body.watchKey('clipboardPaste', e => {
|
||||
// just send event to the current active map
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
|
||||
@@ -43,6 +43,11 @@ define([
|
||||
keyNames: ['CONTROL', 'V'],
|
||||
alias: 'paste'
|
||||
},
|
||||
renameSystem: {
|
||||
group: 'map',
|
||||
label: 'Rename system',
|
||||
keyNames: ['ALT', 'N']
|
||||
},
|
||||
newSignature: {
|
||||
group: 'signatures',
|
||||
label: 'New Signature',
|
||||
|
||||
@@ -3176,7 +3176,7 @@ define([
|
||||
},
|
||||
onScrollStart: function(){
|
||||
// hide all open xEditable fields
|
||||
$(this).find('.editable').editable('hide');
|
||||
$(this).find('.editable.editable-open').editable('hide');
|
||||
|
||||
// hide all system head tooltips
|
||||
$(this).find('.' + config.systemHeadClass + ' .fa').tooltip('hide');
|
||||
|
||||
@@ -85,10 +85,11 @@ define([
|
||||
* -> subtract some offset for tooltips/connections
|
||||
* @param scrollWrapper
|
||||
* @param position
|
||||
* @param options
|
||||
*/
|
||||
let scrollToSystem = (scrollWrapper, position) => {
|
||||
let scrollToSystem = (scrollWrapper, position, options) => {
|
||||
position = getOffsetPosition(position, {x: -15, y: -35});
|
||||
scrollToPosition(scrollWrapper, position);
|
||||
scrollToPosition(scrollWrapper, position, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -778,6 +778,14 @@ define([
|
||||
return zoomChange;
|
||||
};
|
||||
|
||||
/**
|
||||
* toggles editable input form for system rename (set alias)
|
||||
* @param system
|
||||
*/
|
||||
let toggleSystemAliasEditable = system => {
|
||||
system.find('.editable').editable('toggle');
|
||||
};
|
||||
|
||||
/**
|
||||
* mark system as "selected" e.g. for dragging
|
||||
* @param map
|
||||
@@ -1999,6 +2007,7 @@ define([
|
||||
filterMapByScopes: filterMapByScopes,
|
||||
changeZoom: changeZoom,
|
||||
setZoom: setZoom,
|
||||
toggleSystemAliasEditable: toggleSystemAliasEditable,
|
||||
storeLocaleCharacterData: storeLocaleCharacterData,
|
||||
getLocaleData: getLocaleData,
|
||||
storeLocalData: storeLocalData,
|
||||
|
||||
@@ -119,11 +119,21 @@ define([
|
||||
return this.each((i, body) => {
|
||||
body = $(body);
|
||||
|
||||
body.watchKey('tabReload', (body) => {
|
||||
body.watchKey('tabReload', body => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
body.watchKey('newSignature', (body) => {
|
||||
body.watchKey('renameSystem', body => {
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
let activeSystem = activeMap.find('.' + MapUtil.config.systemActiveClass + ':first');
|
||||
if(activeSystem.length){
|
||||
MapUtil.toggleSystemAliasEditable(activeSystem);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
body.watchKey('newSignature', body => {
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
let mapContentElement = MapUtil.getTabContentElementByMapElement(activeMap);
|
||||
@@ -132,7 +142,7 @@ define([
|
||||
}
|
||||
});
|
||||
|
||||
body.watchKey('clipboardPaste', (e) => {
|
||||
body.watchKey('clipboardPaste', e => {
|
||||
// just send event to the current active map
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
if(activeMap){
|
||||
|
||||
Reference in New Issue
Block a user