- fixed not updating connection type information, closed #317
This commit is contained in:
@@ -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 ){
|
||||
|
||||
@@ -19,6 +19,8 @@ define([
|
||||
* main init "map" page
|
||||
*/
|
||||
$(function(){
|
||||
Util.initPrototypes();
|
||||
|
||||
// set default AJAX config
|
||||
Util.ajaxSetup();
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 ){
|
||||
|
||||
@@ -19,6 +19,8 @@ define([
|
||||
* main init "map" page
|
||||
*/
|
||||
$(function(){
|
||||
Util.initPrototypes();
|
||||
|
||||
// set default AJAX config
|
||||
Util.ajaxSetup();
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user