Rewrite external task view component in vanilla javascript

This commit is contained in:
Frederic Guillot 2016-11-21 23:01:17 -05:00
parent 8976f4d15c
commit d3cb436eb5
No known key found for this signature in database
GPG Key ID: 92D77191BA7FBC99
3 changed files with 9 additions and 14 deletions

View File

@ -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

View File

@ -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>');
}
});
}