* zin: modify addRow params of thinktableinput.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user