Improve TemplateWidget JavaScript
Move widget initialization from form to field. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
var fieldNameID = '#id_template_model_property';
|
||||
var fieldNameID = '[data-template-fields="model_property"]';
|
||||
$(fieldNameID).change(function(event) {
|
||||
var $idModelProperty = $(this);
|
||||
var $idTemplate = $('#id_template_template');
|
||||
var $idTemplate = $('[data-template-fields="template"]');
|
||||
var templateCursorPosition = $idTemplate.prop('selectionStart');
|
||||
var templateValue = $idTemplate.val();
|
||||
var modelVariable = $idTemplate.data('model-variable');
|
||||
|
||||
Reference in New Issue
Block a user