Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 1325c54

Browse files
committed
change code-preview requests to use Vue.http instead of this.$http
1 parent 4b86e23 commit 1325c54

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

resources/views/components/code-preview.blade.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@
6060
showFeature: function(feature) {
6161
6262
// fetch the contents of the current feature
63-
this.$http.get('features/'+feature.title).then(
63+
Vue.http.get('features/'+feature.title).then(
6464
// success
6565
function (response) {
6666
// set the currently viewing feature
67-
this.$set('currentFeature', response.json());
67+
this.currentFeature = response.json();
6868
69-
this.$set('isCodeShowing', true);
69+
this.isCodeShowing = true;
7070
7171
this.showFeatureCodeDialog();
7272
7373
// generate and set highlighted content for this feature
74-
this.$set('currentFeature.highlightedContent', Prism.highlight(this.$get('currentFeature.content'), Prism.languages.php));
75-
},
74+
this.currentFeature.highlightedContent = Prism.highlight(this.currentFeature.content, Prism.languages.php);
75+
}.bind(this),
7676
// error
7777
function (response) {
7878
console.log('Error fetching feature details', response.status);
@@ -93,19 +93,19 @@ function (response) {
9393
showJob: function(job) {
9494
console.log(job.title);
9595
// fetch the contents of the current job
96-
this.$http.get('jobs/'+job.title).then(
96+
Vue.http.get('jobs/'+job.title).then(
9797
// success
9898
function (response) {
9999
// set the currently viewing job
100-
this.$set('currentJob', response.json());
100+
this.currentJob = response.json();
101101
102-
this.$set('isCodeShowing', true);
102+
this.isCodeShowing = true;
103103
104104
this.showJobCodeDialog();
105105
106106
// generate and set highlighted content for this job
107-
this.$set('currentJob.highlightedContent', Prism.highlight(this.$get('currentJob.content'), Prism.languages.php));
108-
},
107+
this.currentJob.highlightedContent = Prism.highlight(this.currentJob.content, Prism.languages.php);
108+
}.bind(this),
109109
// error
110110
function (response) {
111111
console.log('Error fetching job details', response.status);

0 commit comments

Comments
 (0)