diff --git a/js/app/map/map.js b/js/app/map/map.js
index fdd36e57..78360627 100644
--- a/js/app/map/map.js
+++ b/js/app/map/map.js
@@ -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 ){
diff --git a/js/app/mappage.js b/js/app/mappage.js
index 357b4e83..1d69719b 100644
--- a/js/app/mappage.js
+++ b/js/app/mappage.js
@@ -19,6 +19,8 @@ define([
* main init "map" page
*/
$(function(){
+ Util.initPrototypes();
+
// set default AJAX config
Util.ajaxSetup();
diff --git a/js/app/util.js b/js/app/util.js
index 58177845..24244b14 100644
--- a/js/app/util.js
+++ b/js/app/util.js
@@ -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,
diff --git a/js/lib/jquery.dragToSelect.js b/js/lib/jquery.dragToSelect.js
index 0a3504b1..e37756fb 100644
--- a/js/lib/jquery.dragToSelect.js
+++ b/js/lib/jquery.dragToSelect.js
@@ -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('
')
+ var selectBox = $('')
.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',
diff --git a/public/js/v1.1.6/app/map/map.js b/public/js/v1.1.6/app/map/map.js
index fdd36e57..78360627 100644
--- a/public/js/v1.1.6/app/map/map.js
+++ b/public/js/v1.1.6/app/map/map.js
@@ -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 ){
diff --git a/public/js/v1.1.6/app/mappage.js b/public/js/v1.1.6/app/mappage.js
index 357b4e83..1d69719b 100644
--- a/public/js/v1.1.6/app/mappage.js
+++ b/public/js/v1.1.6/app/mappage.js
@@ -19,6 +19,8 @@ define([
* main init "map" page
*/
$(function(){
+ Util.initPrototypes();
+
// set default AJAX config
Util.ajaxSetup();
diff --git a/public/js/v1.1.6/app/util.js b/public/js/v1.1.6/app/util.js
index 58177845..24244b14 100644
--- a/public/js/v1.1.6/app/util.js
+++ b/public/js/v1.1.6/app/util.js
@@ -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,
diff --git a/public/js/v1.1.6/lib/jquery.dragToSelect.js b/public/js/v1.1.6/lib/jquery.dragToSelect.js
index 0a3504b1..e37756fb 100644
--- a/public/js/v1.1.6/lib/jquery.dragToSelect.js
+++ b/public/js/v1.1.6/lib/jquery.dragToSelect.js
@@ -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('
')
+ var selectBox = $('
')
.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',