Rewrite external task view component in vanilla javascript
This commit is contained in:
@@ -161,7 +161,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (! empty($task['external_uri']) && ! empty($task['external_provider'])): ?>
|
<?php if (! empty($task['external_uri']) && ! empty($task['external_provider'])): ?>
|
||||||
<external-task-view url="<?= $this->url->href('ExternalTaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])) ?>"></external-task-view>
|
<?= $this->app->component('external-task-view', array(
|
||||||
|
'url' => $this->url->href('ExternalTaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
||||||
|
)) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($editable && empty($task['date_started'])): ?>
|
<?php if ($editable && empty($task['date_started'])): ?>
|
||||||
|
|||||||
2
assets/js/app.min.js
vendored
2
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,18 +1,11 @@
|
|||||||
Vue.component('external-task-view', {
|
KB.component('external-task-view', function (containerElement, options) {
|
||||||
props: ['url'],
|
|
||||||
template: '<div id="external-task-view" v-show="content">{{{ content }}}</div>',
|
this.render = function () {
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
content: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
ready: function () {
|
|
||||||
var self = this;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
cache: false,
|
cache: false,
|
||||||
url: this.url,
|
url: options.url,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
self.content = data;
|
KB.el(containerElement).html('<div id="external-task-view">' + data + '</div>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user