-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the use of Jquery in Vue objects #422
Conversation
Codecov Report
@@ Coverage Diff @@
## switch_to_vue #422 +/- ##
==============================================
Coverage 95.24% 95.24%
==============================================
Files 96 96
Lines 4102 4102
Branches 255 255
==============================================
Hits 3907 3907
Misses 143 143
Partials 52 52 Continue to review full report at Codecov.
|
@@ -51,5 +51,7 @@ require([ | |||
ga_observer.trigger_application_starting(application.app_data.image.name); | |||
}); | |||
|
|||
app_list_view.$on('focus_iframe', function() { app_view.focus_iframe(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just check on click event instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, it didn't work. So I just renamed the event to entry_clicked
@@ -51,5 +51,7 @@ require([ | |||
ga_observer.trigger_application_starting(application.app_data.image.name); | |||
}); | |||
|
|||
app_list_view.$on('entry_clicked', function() { app_view.focus_iframe(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only clicked. You don't need another event. clicked is already an event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename it clicked
, but I will still need to emit the event with the $emit
method. You want me to rename it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the other comment, it sounds like "clicked" or "click" are not built-in events for the $on
method of Vue. I think it's not really related to the javascript method addEventListener("click", myFunction)
. We can only use the $on
method with custom events and trigger them with the $emit
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a design, it makes no sense, but we can't do otherwise. I'd say add a comment as a reminder if someone is confused for the same reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried app_list_view.$on('click.native', myFunction)
according to the documentation but it sounds like the .native
modifier doesn't work for $on
, but only for v-on
in templates.
@stefanoborini Ok to merge or you would prefer to rename the event from |
@@ -51,5 +51,7 @@ require([ | |||
ga_observer.trigger_application_starting(application.app_data.image.name); | |||
}); | |||
|
|||
app_list_view.$on('entry_clicked', function() { app_view.focus_iframe(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a design, it makes no sense, but we can't do otherwise. I'd say add a comment as a reminder if someone is confused for the same reason.
No description provided.