Replace the deprecated `addListener` method from the example for MediaQueryList
gbhasha opened this issue · comments
Noticed in this example at line#56,
https://github.com/mdn/dom-examples/blob/master/mediaquerylist/index.html
The usage of deprecated addListener
method can be replaced with addEventListener
@sobhanbera I am more than happy for you to have a go at this. I've assigned you to the task. Let me know if you want a review, andif you want me to delete pages, etc.
@chrisdavidmills I want help to contribute.
Please provide some details on how can I write code like what to provide(output) through the code.
I saw that the index.html file already contains 'addEventListener'
Thanks
@sobhanbera the example has been updated; the remainder of the work I'd like you to contribute with involves updating the MDN documentation for MediaQueryList
to make sure they are updated too.
So for example:
- The code example on the main landing page for
MediaQueryList
looks to have been updated so it doesn't mentionaddListener
, but what about examples and text on other pages? - The
addListener
andremoveListener
links and descriptions listed inside the "Methods" section of the page should probably be put under a subheading of "Obsolete methods", as we are trying to make it clear that they are not to be used. - The
change
event needs a page creating for it. Let me know if you are OK to do that, and I'll create a page for you to add the content to. You'd need to look at an existing event page, copy the structure over, and change it to be appropriate for the mql.change event. - Anything else you can see that you think needs updating?
@chrisdavidmills I am ok with this info? please create a page I would start working.
So, I just need to provide an example of mql.addEventListener("change", event)
, according to you?
@sobhanbera the steps I think you need to take to complete this work are listed in my comment above (#62 (comment)). No page needs to be created — it is all work on existing pages.
This issue is fixed here.
mdn/content#19635