From dec582843b5249a84e9e3d71d58c6033168d6652 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 12 Mar 2012 16:33:16 +0100 Subject: [PATCH] Fix: try to use jeditable autocomplete (not stable) --- htdocs/core/js/editinplace.js | 31 +++++++++++++++++++++++++- htdocs/theme/auguria/style.css.php | 6 ++--- htdocs/theme/bureau2crea/style.css.php | 6 ++--- htdocs/theme/cameleo/style.css.php | 6 ++--- htdocs/theme/eldy/style.css.php | 6 ++--- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js index d7129930621..7748b73fce6 100644 --- a/htdocs/core/js/editinplace.js +++ b/htdocs/core/js/editinplace.js @@ -271,16 +271,45 @@ $(document).ready(function() { $('.editval_autocomplete').editable(urlSaveInPlace, { type : 'autocomplete', id : 'field', - onblur : 'submit', + width : 300, + onblur : 'ignore', tooltip : tooltipInPlace, + placeholder : ' ', + cancel : cancelInPlace, + submit : submitInPlace, indicator : indicatorInPlace, autocomplete : { source : urlLoadInPlace, data : function(result, settings) { return getParameters(this, 'select'); } + }, + submitdata : function(result, settings) { + return getParameters(this, 'select'); + }, + callback : function(result, settings) { + getResult(this, result); + }, + onreset : function(result, settings) { + getDefault(settings); } }); + $('.editkey_autocomplete').hover( + function () { + $('#viewval_' + $(this).attr('id')).addClass("viewval_hover"); + }, + function () { + $('#viewval_' + $(this).attr('id')).removeClass("viewval_hover"); + } + ); + $('.viewval_autocomplete.active').click(function() { + $('#viewval_' + $(this).attr('id').substr(8)).hide(); + $('#editval_' + $(this).attr('id').substr(8)).show().click(); + }); + $('.editkey_autocomplete').click(function() { + $('#viewval_' + $(this).attr('id')).hide(); + $('#editval_' + $(this).attr('id')).show().click(); + }); function getParameters(obj, type) { var htmlname = $(obj).attr('id').substr(8); diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index dc325c2a979..3d547852aa5 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1670,7 +1670,7 @@ table.cal_event td { border: 0px; padding-: 0px; padding-) right top no-repeat; cursor: pointer; } @@ -1680,12 +1680,12 @@ table.cal_event td { border: 0px; padding-: 0px; padding-: 0px; padding-) right top no-repeat; cursor: pointer; } @@ -1880,12 +1880,12 @@ table.cal_event td { border: 0px; padding-: 0px; padding-: 0px; padding-) right top no-repeat; cursor: pointer; } @@ -1815,12 +1815,12 @@ table.cal_event td { border: 0px; padding-: 0px; padding-: 0px; padding-) right top no-repeat; cursor: pointer; } @@ -1990,12 +1990,12 @@ table.cal_event td { border: 0px; padding-: 0px; padding-