rename methode and class for inline editiing of document name

This commit is contained in:
Uwe Steinmann 2025-04-29 10:34:16 +02:00
parent e069f784b4
commit d377bd81ab
5 changed files with 7 additions and 9 deletions

View File

@ -2552,9 +2552,9 @@ $(function() {
*
* @param string text
*/
function printInlineEdit($text, $object){ /* {{{ */
function printInlineEditDocumentName($text, $object){ /* {{{ */
if(!empty($this->params['settings']->_inlineEditing)) {
echo "<span class=\"editable\" contenteditable=\"true\"";
echo "<span class=\"editdocname editable\" contenteditable=\"true\"";
if($object->isType('document'))
echo " data-document=\"".$object->getId()."\" data-formtoken=\"".createFormKey('setdocumentname')."\"";
echo ">".$text;

View File

@ -413,7 +413,7 @@ $(document).ready( function() {
?>
<tr>
<td><?php printMLText("name");?>:</td>
<td><?php $this->printInlineEdit(htmlspecialchars($document->getName()), $document);?></td>
<td><?php $this->printInlineEditDocumentName(htmlspecialchars($document->getName()), $document);?></td>
</tr>
<tr>
<td><?php printMLText("owner");?>:</td>

View File

@ -721,8 +721,7 @@ $(document).ready( function() {
window.history.back();
}); /* }}} */
$("body").on("blur", "span.editable", function(e) { /* {{{ */
console.log($(this).data('document'));
$("body").on("blur", "span.editdocname", function(e) { /* {{{ */
e.preventDefault();
$.post(seeddms_webroot+"op/op.Ajax.php", { command: "setdocumentname", id: $(this).data('document'), formtoken: $(this).data('formtoken'), name: $(this).text() })
.done(function( data ) {

View File

@ -2578,9 +2578,9 @@ $(function() {
*
* @param string text
*/
function printInlineEdit($text, $object){ /* {{{ */
function printInlineEditDocumentName($text, $object){ /* {{{ */
if(!empty($this->params['settings']->_inlineEditing)) {
echo "<span class=\"editable\" contenteditable=\"true\"";
echo "<span class=\"editdocname editable\" contenteditable=\"true\"";
if($object->isType('document'))
echo " data-document=\"".$object->getId()."\" data-formtoken=\"".createFormKey('setdocumentname')."\"";
echo ">".$text;

View File

@ -769,8 +769,7 @@ $(document).ready( function() {
window.history.back();
}); /* }}} */
$("body").on("blur", "span.editable", function(e) { /* {{{ */
console.log($(this).data('document'));
$("body").on("blur", "span.editdocname", function(e) { /* {{{ */
e.preventDefault();
$.post(seeddms_webroot+"op/op.Ajax.php", { command: "setdocumentname", id: $(this).data('document'), formtoken: $(this).data('formtoken'), name: $(this).text() })
.done(function( data ) {