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) { ...@@ -11,6 +11,9 @@ var createForm = function(typeCreateForm) {
var fixmeOffset = 35; var fixmeOffset = 35;
var incrementationId = 0; var incrementationId = 0;
var nomVariable = true; var nomVariable = true;
// -------------------------------------------------
refresh(); refresh();
$(idContainer).resizable({ $(idContainer).resizable({
...@@ -20,8 +23,8 @@ var createForm = function(typeCreateForm) { ...@@ -20,8 +23,8 @@ var createForm = function(typeCreateForm) {
var repositionFieldOnGrid = function(field) { var repositionFieldOnGrid = function(field) {
var container = $(idContainer), var container = $(idContainer),
snapTolerance = $(field).draggable('option', 'snapTolerance'), snapTolerance = $(field).draggable('option', 'snapTolerance'),
top = $(field).position().top - ($(field).position().top % snapTolerance), top = (Math.round($(field).position().top) - (Math.round($(field).position().top % snapTolerance))),
left = ($(field).position().left < $(container).width() / 2) ? 0 : ($(container).width() / 2) + 1; 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'}); field.css({ 'left': left + 'px', 'top': top + 'px'});
}; };
...@@ -351,7 +354,8 @@ var createForm = function(typeCreateForm) { ...@@ -351,7 +354,8 @@ var createForm = function(typeCreateForm) {
* @param {type} object * @param {type} object
* @returns {undefined} * @returns {undefined}
*/ */
function displayDetails(object) { function displayDetails(object)
{
var champId = null, var champId = null,
options = null, options = null,
check = null, check = null,
...@@ -772,7 +776,8 @@ var createForm = function(typeCreateForm) { ...@@ -772,7 +776,8 @@ var createForm = function(typeCreateForm) {
* *
* @returns {undefined} * @returns {undefined}
*/ */
function hideDetails() { function hideDetails()
{
$(fieldOptions+">div").remove(); $(fieldOptions+">div").remove();
} }
...@@ -782,7 +787,8 @@ var createForm = function(typeCreateForm) { ...@@ -782,7 +787,8 @@ var createForm = function(typeCreateForm) {
* @param {type} nom * @param {type} nom
* @returns {undefined} * @returns {undefined}
*/ */
function checkName(nom) { function checkName(nom)
{
var success = false; var success = false;
if (nom === "") { 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