Fixed somethings in the selection box.

This commit is contained in:
mdtrooper 2016-04-01 11:54:31 +02:00
parent 496313b2ec
commit 651b405c42

View File

@ -39,7 +39,6 @@ MapController.prototype._slider = null;
MapController.prototype._relation = null; MapController.prototype._relation = null;
MapController.prototype._start_multiple_selection = false; MapController.prototype._start_multiple_selection = false;
MapController.prototype._flag_multiple_selection = false; MapController.prototype._flag_multiple_selection = false;
MapController.prototype._stop_dragging = false;
MapController.prototype._cache_files = {}; MapController.prototype._cache_files = {};
MapController.prototype._last_event = null; MapController.prototype._last_event = null;
MapController.prototype._last_mouse_position = null; MapController.prototype._last_mouse_position = null;
@ -1339,16 +1338,11 @@ MapController.prototype.init_events = function(principalObject) {
.on("keydown", function() { .on("keydown", function() {
// ctrl key // ctrl key
if (d3.event.keyCode === CONTROL_KEY) { if (d3.event.keyCode === CONTROL_KEY) {
self._flag_multiple_selection = true;
self._stop_dragging = true;
self.multiple_selection_start(); self.multiple_selection_start();
} }
}) })
.on("keyup", function() { .on("keyup", function() {
if (d3.event.keyCode === CONTROL_KEY) { if (d3.event.keyCode === CONTROL_KEY) {
self._flag_multiple_selection = false;
self._stop_dragging = false;
self.multiple_selection_end(); self.multiple_selection_end();
} }
}); });
@ -1853,6 +1847,8 @@ MapController.prototype.get_status_selection_node = function(id_node) {
MapController.prototype.multiple_selection_start = function() { MapController.prototype.multiple_selection_start = function() {
var self = this; var self = this;
self._flag_multiple_selection = true;
if (!self._cache_files.hasOwnProperty("selection_box")) { if (!self._cache_files.hasOwnProperty("selection_box")) {
var selection_box = d3 var selection_box = d3
.select(self._target + " svg") .select(self._target + " svg")
@ -1954,6 +1950,8 @@ MapController.prototype.multiple_selection_dragging = function(x, y, first) {
MapController.prototype.multiple_selection_end = function() { MapController.prototype.multiple_selection_end = function() {
var self = this; var self = this;
self._flag_multiple_selection = false;
var selection_box = d3 var selection_box = d3
.select(self._target + " #selection_box"); .select(self._target + " #selection_box");