* zin: modify addRow params of thinktableinput.

This commit is contained in:
Zhangyu
2024-05-27 03:19:08 +00:00
parent 0838d5439d
commit 41f373ea3d
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -34,8 +34,8 @@ function setLineIndex()
window.addRow = function(e)
{
if($('.rows-group').length >= canAddRows) return;
var parentFormGroup = $(e.target || e).closest('.form-group');
var $newRow = $('.rows-template').clone();
const parentFormGroup = $(e.target || e).closest('.form-group');
const $newRow = $('.rows-template').clone();
$newRow.find('.btn-add').attr('onclick', 'addRow(this)');
$newRow.removeClass('rows-template').removeClass('hidden').addClass('rows-group');
$newRow.find('textarea').val('');
@@ -44,11 +44,11 @@ window.addRow = function(e)
setLineIndex();
}
$(document).bind('click', '.btn-delete', function() {
$(document).on('click', '.btn-delete', function() {
zui.Modal.confirm({message: deleteTip}).then((res) => {
if(res)
{
var $row = $(this).closest('.form-group');
const $row = $(this).closest('.form-group');
$row.remove();
if(canAddRows == 1) $('.add-rows').removeClass('disabled');
setLineIndex();
+3 -3
View File
@@ -76,7 +76,7 @@ class thinkTableInput extends thinkQuestion
(
'plus',
setClass('mr-1 btn-add ml-2 text-sm text-primary add-rows'),
bind::click('addRow'),
bind::click('addRow(event)'),
set::title(sprintf($lang->thinkrun->addTips, $canAddRows)),
) : null,
)
@@ -117,7 +117,7 @@ class thinkTableInput extends thinkQuestion
(
'plus',
setClass('mr-1 btn-add ml-2 text-sm text-primary add-rows'),
bind::click('addRow'),
bind::click('addRow(event)'),
set::title(sprintf($lang->thinkrun->addTips, $canAddRows)),
),
icon
@@ -159,7 +159,7 @@ class thinkTableInput extends thinkQuestion
(
'plus',
setClass('mr-1 btn-add ml-2 text-sm text-primary add-rows'),
bind::click('addRow'),
bind::click('addRow(event)'),
set::title(sprintf($lang->thinkrun->addTips, $canAddRows)),
),
icon