Commit 1d8280b1 authored by tguillon's avatar tguillon
Browse files

Correction : positionnement des champs dans le formulaire (jquery), arrondi des champs top et left

parent c6e7c29a
......@@ -11,6 +11,9 @@ var createForm = function(typeCreateForm) {
var fixmeOffset = 35;
var incrementationId = 0;
var nomVariable = true;
// -------------------------------------------------
refresh();
$(idContainer).resizable({
......@@ -20,8 +23,8 @@ var createForm = function(typeCreateForm) {
var repositionFieldOnGrid = function(field) {
var container = $(idContainer),
snapTolerance = $(field).draggable('option', 'snapTolerance'),
top = $(field).position().top - ($(field).position().top % snapTolerance),
left = ($(field).position().left < $(container).width() / 2) ? 0 : ($(container).width() / 2) + 1;
top = (Math.round($(field).position().top) - (Math.round($(field).position().top % snapTolerance))),
left = (Math.round($(field).position().left) < Math.round($(container).width() / 2)) ? 0 : (Math.round(($(container).width() / 2) + 1));
field.css({ 'left': left + 'px', 'top': top + 'px'});
};
......@@ -351,7 +354,8 @@ var createForm = function(typeCreateForm) {
* @param {type} object
* @returns {undefined}
*/
function displayDetails(object) {
function displayDetails(object)
{
var champId = null,
options = null,
check = null,
......@@ -772,7 +776,8 @@ var createForm = function(typeCreateForm) {
*
* @returns {undefined}
*/
function hideDetails() {
function hideDetails()
{
$(fieldOptions+">div").remove();
}
......@@ -782,7 +787,8 @@ var createForm = function(typeCreateForm) {
* @param {type} nom
* @returns {undefined}
*/
function checkName(nom) {
function checkName(nom)
{
var success = false;
if (nom === "") {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment