2
0
forked from Wavyzz/dolibarr

Fix: move jnotify options in separate file

Fix: move nl2br treatment
New: add error message for edit in place
This commit is contained in:
Regis Houssin
2011-10-28 12:02:36 +02:00
parent 4439205375
commit bc6fa60287
10 changed files with 139 additions and 91 deletions

View File

@@ -7,62 +7,93 @@
$(document).ready(function() {
$(document).ready(function() {
var element = $('#element').html();
var table_element = $('#table_element').html();
var fk_element = $('#fk_element').html();
$('.edit_area').editable(urlSaveInPlace, {
type : 'textarea',
rows : 4,
id : 'field',
tooltip : tooltipInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
},
submitdata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
var element = $('#element').html();
var table_element = $('#table_element').html();
var fk_element = $('#fk_element').html();
$('.edit_area').editable(urlSaveInPlace, {
type : 'textarea',
rows : 4,
id : 'field',
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
},
submitdata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
});
$('.edit_text').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 300,
tooltip : tooltipInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'text',
element: element,
table_element: table_element,
fk_element: fk_element
}
});
$('.edit_text').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 300,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'text',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
});
$('.edit_numeric').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 100,
tooltip : tooltipInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'numeric',
element: element,
table_element: table_element,
fk_element: fk_element
}
});
$('.edit_numeric').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 100,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'numeric',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
});
}
});
});