', {
+ class: [config.dynamicAreaClass, config.controlAreaClass, config.moduleHeadlineIconClass].join(' '),
+ html: '
load more'
+ });
+ return controlElement;
+ };
+
+ /**
+ * @param moduleElement
+ * @param systemData
+ */
+ let setModuleObserver = (moduleElement, systemData) => {
+ moduleElement.on('click', '.' + config.controlAreaClass, function(){
+ let killboardElement = moduleElement.find('.' + config.systemKillboardListClass);
+ showKills(killboardElement, systemData.systemId, config.chunkCountKills);
+ });
+ };
+
/**
* before module "show" callback
* @param moduleElement
@@ -396,6 +341,8 @@ define([
)
);
+ setModuleObserver(moduleElement, systemData);
+
return moduleElement;
};
diff --git a/js/app/ui/module/system_signature.js b/js/app/ui/module/system_signature.js
index bb552edf5..c48866a26 100644
--- a/js/app/ui/module/system_signature.js
+++ b/js/app/ui/module/system_signature.js
@@ -606,7 +606,12 @@ define([
let signatureOptions = {
deleteOld: (formData.deleteOld) ? 1 : 0
};
- updateSignatureTableByClipboard(moduleElement, systemData, formData.clipboard, signatureOptions);
+
+ let mapId = moduleElement.data('mapId');
+ let systemId = moduleElement.data('systemId');
+ let tableApi = getDataTableInstance(mapId, systemId, 'primary');
+
+ updateSignatureTableByClipboard(tableApi, systemData, formData.clipboard, signatureOptions);
}
}
}
@@ -975,7 +980,6 @@ define([
let activateNextCell = (tableApi, cell, columnSelectors) => {
let nextCell = searchNextCell(tableApi, cell, columnSelectors);
activateCell(nextCell);
- let test;
};
/**
@@ -1149,6 +1153,22 @@ define([
// xEditable sets 'tabindex = -1'
};
+ /**
+ * en/disables xEditable element (select)
+ * -> disables if there are no source options found
+ * @param element
+ */
+ let editableSelectCheck = element => {
+ if(element.data('editable')){
+ let options = element.data('editable').options.source();
+ if(options.length > 0){
+ editableEnable(element);
+ }else{
+ editableDisable(element);
+ }
+ }
+ };
+
/**
* get dataTables default options for signature tables
* @param mapId
@@ -1328,31 +1348,16 @@ define([
}
tableApi.draw();
- // find related "type" select (same row) and change options
+ // find related "type" select (same row) and change options ---------------------------
let signatureTypeCell = getNeighboringCell(tableApi, cell, 'type:name');
let signatureTypeField = signatureTypeCell.nodes().to$();
+ editableSelectCheck(signatureTypeField);
- let typeOptions = getAllSignatureNames(
- systemData,
- systemData.type.id,
- Util.getAreaIdBySecurity(systemData.security),
- newValue
- );
- signatureTypeField.editable('option', 'source', typeOptions);
-
- if(
- newValue > 0 &&
- typeOptions.length > 0
- ){
- editableEnable(signatureTypeField);
- }else{
- editableDisable(signatureTypeField);
- }
signatureTypeCell.data(0);
signatureTypeField.editable('setValue', 0);
- // find "connection" select (same row) and change "enabled" flag
+ // find "connection" select (same row) and change "enabled" flag ----------------------
let signatureConnectionCell = getNeighboringCell(tableApi, cell, 'connection:name');
let signatureConnectionField = signatureConnectionCell.nodes().to$();
@@ -2255,6 +2260,26 @@ define([
// xEditable is active -> should always be active!
// set new value even if no change -> e.g. render selected Ids as text labels
let oldValue = node.editable('getValue', true);
+
+ // ... some editable cells depend on each other (e.g. group->type, group->connection)
+ switch(node.data('editable').options.name){
+ case 'typeId':
+ // ... disable if no type options found
+ editableSelectCheck(node);
+ break;
+ case 'connectionId':
+ // disables if no wormhole group set
+ let groupId = cell.cell(rowIndex, 'group:name').data();
+ if(groupId === 5){
+ // wormhole
+ editableEnable(node);
+ }else{
+ editableDisable(node);
+ }
+ break;
+ }
+
+ // values should be set AFTER en/disabling of a field
node.editable('setValue', cell.data());
if(oldValue !== cell.data()){
@@ -2340,6 +2365,9 @@ define([
// table data changed -> draw() table changes
tableApi.draw();
+ // check for "leads to" conflicts -> important if there are just "update" (no add/delete) changes
+ checkConnectionConflicts();
+
if(!updateEmptyTable){
// no notifications if table was empty just progressbar notification is needed
// sum payloads by "action"
diff --git a/js/app/util.js b/js/app/util.js
index bd6306e80..4df9a4157 100644
--- a/js/app/util.js
+++ b/js/app/util.js
@@ -25,6 +25,9 @@ define([
ajaxOverlayClass: 'pf-loading-overlay',
ajaxOverlayWrapperClass: 'pf-loading-overlay-wrapper',
+ // page
+ noScrollClass: 'no-scroll',
+
// form
formEditableFieldClass: 'pf-editable', // class for all xEditable fields
formErrorContainerClass: 'pf-dialog-error-container', // class for "error" containers in dialogs
@@ -497,6 +500,8 @@ define([
let data = {};
if(
+ tooltipData.created &&
+ tooltipData.updated &&
tooltipData.created.character &&
tooltipData.updated.character
){
@@ -522,39 +527,41 @@ define([
createdStatusClass: statusCreatedClass,
updatedStatusClass: statusUpdatedClass
};
- }
- let defaultOptions = {
- placement: 'top',
- html: true,
- trigger: 'hover',
- container: 'body',
- title: 'Created / Updated',
- delay: {
- show: 150,
- hide: 0
- }
- };
+ let defaultOptions = {
+ placement: 'top',
+ html: true,
+ trigger: 'hover',
+ container: 'body',
+ title: 'Created / Updated',
+ delay: {
+ show: 150,
+ hide: 0
+ }
+ };
- options = $.extend({}, defaultOptions, options);
+ options = $.extend({}, defaultOptions, options);
- return this.each(function(){
- let element = $(this);
+ return this.each(function(){
+ let element = $(this);
- requirejs(['text!templates/tooltip/character_info.html', 'mustache'], (template, Mustache) => {
- let content = Mustache.render(template, data);
+ requirejs(['text!templates/tooltip/character_info.html', 'mustache'], (template, Mustache) => {
+ let content = Mustache.render(template, data);
- element.popover(options);
+ element.popover(options);
- // set new popover content
- let popover = element.data('bs.popover');
- popover.options.content = content;
+ // set new popover content
+ let popover = element.data('bs.popover');
+ popover.options.content = content;
- if(options.show){
- element.popover('show');
- }
+ if(options.show){
+ element.popover('show');
+ }
+ });
});
- });
+ }else{
+ return this;
+ }
};
/**
@@ -778,9 +785,7 @@ define([
default: console.error('insertElement: %s is not specified!', defaultOptions.insertElement);
}
- //containerElement.children().first().velocity('stop').velocity('fadeIn');
$('#' + defaultOptions.messageId).velocity('stop').velocity('fadeIn');
-
});
};
@@ -1074,7 +1079,12 @@ define([
callbacks: {
alwaysTriggerOffsets: false, // only trigger callback.onTotalScroll() once
onTotalScrollOffset: 300, // trigger callback.onTotalScroll() 100px before end
- onTotalScroll: function(a){
+ onInit: function(){
+ // disable page scroll -> otherwise page AND customScrollbars will scroll
+ // -> this is because the initPassiveEvents() delegates the mouseWheel events
+ togglePageScroll(false);
+ },
+ onTotalScroll: function(){
// we want to "trigger" Select2´s 'scroll' event
// in order to make its "infinite scrolling" function working
this.mcs.content.find(':first-child').trigger('scroll');
@@ -1117,6 +1127,10 @@ define([
// the only way to prevent this is to remove the element
// https://stackoverflow.com/questions/17995057/prevent-select2-from-autmatically-focussing-its-search-input-when-dropdown-is-op
$(this).parents('.editableform').find(this).next().find('.select2-selection').remove();
+
+ // re-enable page scroll -> might be disabled before by mCustomScrollbar onInit() event
+ // -> in case there is a custom