|
@@ -12,31 +12,13 @@ if(!$loadedData || !@$loadedData->lines || !@$loadedData->dataMap) {
|
|
|
}
|
|
|
?>
|
|
|
<div class="dq-edit-container">
|
|
|
- <div class="dq-definition"><?= json_encode($loadedData->lines) ?></div>
|
|
|
- <div class="dq-data-map"><?= json_encode($loadedData->dataMap) ?></div>
|
|
|
+ <div class="dq-definition d-none"><?= json_encode($loadedData->lines) ?></div>
|
|
|
+ <div class="dq-data-map d-none"><?= json_encode($loadedData->dataMap) ?></div>
|
|
|
@foreach ($template->lines as $line)
|
|
|
@include('app.dq-engine.line', compact('line'))
|
|
|
@endforeach
|
|
|
</div>
|
|
|
-<script>
|
|
|
- (function() {
|
|
|
- function init() {
|
|
|
- $('.dq-edit-container')
|
|
|
- .off('change input paste', 'input, textarea, select')
|
|
|
- .on('change input paste', 'input, textarea, select', function() {
|
|
|
- let key = $(this).closest('.dq-line').attr('dq-key'),
|
|
|
- dataElem = $(this).closest('.dq-edit-container').find('>.dq-data-map').first(),
|
|
|
- current = JSON.parse(dataElem.text());
|
|
|
- current[key] = $(this).val();
|
|
|
- dataElem.text(JSON.stringify(current));
|
|
|
- });
|
|
|
- }
|
|
|
- function populate() {
|
|
|
|
|
|
- }
|
|
|
- addMCInitializer('dq-edit', init, '.dq-edit-container');
|
|
|
- }).call(window);
|
|
|
-</script>
|
|
|
|
|
|
|
|
|
|