Lines 103-110
Link Here
|
103 |
<th>Id</th> |
103 |
<th>Id</th> |
104 |
<th>Entity</th> |
104 |
<th>Entity</th> |
105 |
<th>Code</th> |
105 |
<th>Code</th> |
106 |
<th>Language</th> |
106 |
<th class="lang">Language</th> |
107 |
<th>Translation</th> |
107 |
<th class="translation">Translation</th> |
108 |
<th class="no-sort"> </th> |
108 |
<th class="no-sort"> </th> |
109 |
</tr> |
109 |
</tr> |
110 |
</thead> |
110 |
</thead> |
Lines 296-301
Link Here
|
296 |
} |
296 |
} |
297 |
}); |
297 |
}); |
298 |
|
298 |
|
|
|
299 |
const th_lang_index = document.querySelector('th.lang').cellIndex; |
300 |
const th_translation_index = document.querySelector('th.translation').cellIndex; |
301 |
|
299 |
$("#add_translation").on('submit', function(e){ |
302 |
$("#add_translation").on('submit', function(e){ |
300 |
e.preventDefault(); |
303 |
e.preventDefault(); |
301 |
let localization = { |
304 |
let localization = { |
Lines 312-320
Link Here
|
312 |
} else { |
315 |
} else { |
313 |
var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"btn btn-default btn-xs delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node(); |
316 |
var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"btn btn-default btn-xs delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node(); |
314 |
$( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id ); |
317 |
$( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id ); |
315 |
/* Is there a better way to target contenteditable cells than by index? */ |
318 |
$( new_row.children[th_lang_index] ).prop("contenteditable", true).addClass("lang") |
316 |
$( new_row.children[3] ).prop("contenteditable", true).addClass("lang") |
319 |
$( new_row.children[th_translation_index] ).prop("contenteditable", true).addClass("translation") |
317 |
$( new_row.children[4] ).prop("contenteditable", true).addClass("translation") |
|
|
318 |
show_message({ type: 'success_on_insert', data: success }); |
320 |
show_message({ type: 'success_on_insert', data: success }); |
319 |
} |
321 |
} |
320 |
}, |
322 |
}, |
321 |
- |
|
|