Rewrite external task view component in vanilla javascript
This commit is contained in:
parent
8976f4d15c
commit
d3cb436eb5
|
|
@ -161,7 +161,9 @@
|
|||
</div>
|
||||
|
||||
<?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 if ($editable && empty($task['date_started'])): ?>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,18 +1,11 @@
|
|||
Vue.component('external-task-view', {
|
||||
props: ['url'],
|
||||
template: '<div id="external-task-view" v-show="content">{{{ content }}}</div>',
|
||||
data: function () {
|
||||
return {
|
||||
content: ''
|
||||
};
|
||||
},
|
||||
ready: function () {
|
||||
var self = this;
|
||||
KB.component('external-task-view', function (containerElement, options) {
|
||||
|
||||
this.render = function () {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
url: this.url,
|
||||
url: options.url,
|
||||
success: function(data) {
|
||||
self.content = data;
|
||||
KB.el(containerElement).html('<div id="external-task-view">' + data + '</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue