From 2f2ec2f0654f86dba36c33804935e25b8ed03bea Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Fri, 7 Aug 2015 15:24:09 +0200 Subject: [PATCH] - Improved the positioning and CSS of the configurator and the color picker. --- HISTORY.md | 1 + dist/vis.js | 6 +++--- lib/shared/Configurator.js | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 4dfaf2a9..a6147f83 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,7 @@ http://visjs.org - Fixed #1152, updating images now works. - Fixed cleaning up of nodes. +- Improved the positioning and CSS of the configurator and the color picker. ## 2015-07-27, version 4.7.0 diff --git a/dist/vis.js b/dist/vis.js index 2ae5ee95..8f0c5fde 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -21567,7 +21567,7 @@ return /******/ (function(modules) { // webpackBootstrap } this._push(); - this.colorPicker.insertTo(this.container); + this.colorPicker.insertTo(document.body); } /** @@ -21821,7 +21821,7 @@ return /******/ (function(modules) { // webpackBootstrap value: function _setupPopup(string, index) { var _this3 = this; - if (this.initialized === true && this.allowCreation === true && this.popupCounter < 4000) { + if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) { var div = document.createElement("div"); div.id = "vis-configuration-popup"; div.className = "vis-configuration-popup"; @@ -21984,7 +21984,7 @@ return /******/ (function(modules) { // webpackBootstrap var rect = div.getBoundingClientRect(); var bodyRect = document.body.getBoundingClientRect(); var pickerX = rect.left + rect.width + 5; - var pickerY = rect.top - bodyRect.top + rect.height * 0.5; + var pickerY = rect.top - bodyRect.top + rect.height + 2; this.colorPicker.show(pickerX, pickerY); this.colorPicker.setColor(value); this.colorPicker.setCallback(function (color) { diff --git a/lib/shared/Configurator.js b/lib/shared/Configurator.js index 48e996cf..eca844c4 100644 --- a/lib/shared/Configurator.js +++ b/lib/shared/Configurator.js @@ -163,7 +163,7 @@ class Configurator { } this._push(); - this.colorPicker.insertTo(this.container); + this.colorPicker.insertTo(document.body); } @@ -388,7 +388,7 @@ class Configurator { * @private */ _setupPopup(string, index) { - if (this.initialized === true && this.allowCreation === true && this.popupCounter < 4000) { + if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) { let div = document.createElement("div"); div.id = "vis-configuration-popup"; div.className = "vis-configuration-popup"; @@ -533,7 +533,7 @@ class Configurator { let rect = div.getBoundingClientRect(); let bodyRect = document.body.getBoundingClientRect(); let pickerX = rect.left + rect.width + 5; - let pickerY = rect.top - bodyRect.top + rect.height*0.5; + let pickerY = rect.top - bodyRect.top + rect.height +2; this.colorPicker.show(pickerX,pickerY); this.colorPicker.setColor(value); this.colorPicker.setCallback((color) => {