- fixed not updating connection type information, closed #317

This commit is contained in:
Exodus4D
2016-09-25 14:19:57 +02:00
parent c1bf70388a
commit d93b6d18af
8 changed files with 42 additions and 12 deletions

View File

@@ -1315,8 +1315,8 @@ define([
setConnectionObserver(map, connection);
}
var addType = $(newConnectionData.type).not(connectionData.type).get();
var removeType = $(connectionData.type).not(newConnectionData.type).get();
var addType = newConnectionData.type.diff( connectionData.type );
var removeType = connectionData.type.diff( newConnectionData.type );
// check if source or target has changed
if(connectionData.source !== newConnectionData.source ){

View File

@@ -19,6 +19,8 @@ define([
* main init "map" page
*/
$(function(){
Util.initPrototypes();
// set default AJAX config
Util.ajaxSetup();

View File

@@ -847,6 +847,18 @@ define([
console.info('PATHFINDER ' + versionNumber);
};
/**
* init utility prototype functions
*/
var initPrototypes = function(){
// Array diff
// [1,2,3,4,5,6].diff( [3,4,5] );
// => [1, 2, 6]
Array.prototype.diff = function(a) {
return this.filter(function(i) {return a.indexOf(i) < 0;});
};
};
/**
* set default configuration for "Bootbox" dialogs
*/
@@ -1818,6 +1830,7 @@ define([
return {
config: config,
showVersionInfo: showVersionInfo,
initPrototypes: initPrototypes,
initDefaultBootboxConfig: initDefaultBootboxConfig,
getCurrentTriggerDelay: getCurrentTriggerDelay,
getServerTime: getServerTime,

View File

@@ -103,12 +103,12 @@ jQuery.fn.dragToSelect = function (conf) {
// Current origin of select box
var selectBoxOrigin = {
left: 0,
left: 0,
top: 0
};
// Create select box
var selectBox = jQuery('<div/>')
var selectBox = $('<div>')
.appendTo(parent)
.attr('class', config.className)
.css('position', 'absolute');
@@ -119,8 +119,8 @@ jQuery.fn.dragToSelect = function (conf) {
return;
}
selectBoxOrigin.left = e.pageX - parentDim.left + parent[0].scrollLeft;
selectBoxOrigin.top = e.pageY - parentDim.top + parent[0].scrollTop;
selectBoxOrigin.left = e.pageX - parentDim.left + parent[0].scrollLeft - 5;
selectBoxOrigin.top = e.pageY - parentDim.top + parent[0].scrollTop - 5;
var css = {
left: selectBoxOrigin.left + 'px',

View File

@@ -1315,8 +1315,8 @@ define([
setConnectionObserver(map, connection);
}
var addType = $(newConnectionData.type).not(connectionData.type).get();
var removeType = $(connectionData.type).not(newConnectionData.type).get();
var addType = newConnectionData.type.diff( connectionData.type );
var removeType = connectionData.type.diff( newConnectionData.type );
// check if source or target has changed
if(connectionData.source !== newConnectionData.source ){

View File

@@ -19,6 +19,8 @@ define([
* main init "map" page
*/
$(function(){
Util.initPrototypes();
// set default AJAX config
Util.ajaxSetup();

View File

@@ -847,6 +847,18 @@ define([
console.info('PATHFINDER ' + versionNumber);
};
/**
* init utility prototype functions
*/
var initPrototypes = function(){
// Array diff
// [1,2,3,4,5,6].diff( [3,4,5] );
// => [1, 2, 6]
Array.prototype.diff = function(a) {
return this.filter(function(i) {return a.indexOf(i) < 0;});
};
};
/**
* set default configuration for "Bootbox" dialogs
*/
@@ -1818,6 +1830,7 @@ define([
return {
config: config,
showVersionInfo: showVersionInfo,
initPrototypes: initPrototypes,
initDefaultBootboxConfig: initDefaultBootboxConfig,
getCurrentTriggerDelay: getCurrentTriggerDelay,
getServerTime: getServerTime,

View File

@@ -103,12 +103,12 @@ jQuery.fn.dragToSelect = function (conf) {
// Current origin of select box
var selectBoxOrigin = {
left: 0,
left: 0,
top: 0
};
// Create select box
var selectBox = jQuery('<div/>')
var selectBox = $('<div>')
.appendTo(parent)
.attr('class', config.className)
.css('position', 'absolute');
@@ -119,8 +119,8 @@ jQuery.fn.dragToSelect = function (conf) {
return;
}
selectBoxOrigin.left = e.pageX - parentDim.left + parent[0].scrollLeft;
selectBoxOrigin.top = e.pageY - parentDim.top + parent[0].scrollTop;
selectBoxOrigin.left = e.pageX - parentDim.left + parent[0].scrollLeft - 5;
selectBoxOrigin.top = e.pageY - parentDim.top + parent[0].scrollTop - 5;
var css = {
left: selectBoxOrigin.left + 'px',