Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Oct 2013 at 14:54 UTC
Updated:
20 Oct 2015 at 09:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nod_oh yes please, never got around to getting rid of it.
( edit ) and guess which module we had to introduce it for initially? Overlay :þ
Comment #2
mile23Drupal.checkWidthBreakpointis marked as @deprecated, but doesn't specify a version for removal.At this point in the release cycle for PHP code we'd say D9.0.0, but I'm not sure about JS.
Comment #3
jesse.voogt commentedHi,
It appears that Drupal 8 is supposed to support IE9, according to https://www.drupal.org/node/61509 , and it doesn't look like matchMedia is supported by IE9 according to http://caniuse.com/#feat=matchmedia. I haven't personally used the deprecated Drupal.checkWidthBreakpoint method, but I suggest if it is an alternative for window.matchMedia that we wait until at least D9.
Comment #4
droplet commented@jesse.voogt
we have matchmedia polyfill in core.
Comment #5
cdog commentedThe attached patch replaces all occurences of the
Drupal.checkWidthBreakpointmethod withwindow.matchMedia. To look for files where it's being used you can use the followinggrepcommand:The patch doesn't remove yet the
Drupal.checkWidthBreakpointfunction definition from./core/misc/drupal.jsas it's marked as deprecated.Comment #6
cdog commentedComment #7
nod_You can remove the function from drupal.js, it doesn't exist in D7 so it was to make sure people didn't start using it in D8.
for vertical tabs the backbone folks are ok with us copying the responsive vtabs they got so it'll go away eventually.
Comment #8
nod_Comment #9
cdog commented@nod_ ok, thanks for your feedback. The new patch removes
Drupal.checkWidthBreakpointentirely from core. Regarding vertical tabs, I'm not aware about those changes. Can you point me in the right direction if there's anything more that should be done related to this issue?Comment #10
nod_This works fine, vtabs still work as expected. Hope it makes it, wouldn't want to ship D8 with new-already-deprecated APIs.
Comment #13
nod_Comment #15
cdog commented@nod_ failed tests doesn't seem related to the patch itself. Is this a normal behavior? Should we queue it for re-testing and update the status every time this happens?
Comment #16
nod_Probably some testbot snafu.
This is a JS-only patch so testbot has nothing to say that's relevant here.
Comment #17
droplet commentedI set it back to "Needs work" anyway, it would need to patch core.libraries.yml and add matchmedia polyfill as dependencies
Comment #18
cdog commented@nod_, @droplet thanks for helping out!
Comment #19
cdog commentedOops,
core/misc/drupal.jsdoesn't require thematchmediadependency.Comment #20
nod_Good call :) forgot that it was even a polyfill.
Old browsers…
Comment #21
alexpottNeeds a reroll :(
Comment #22
nod_on it.
Comment #23
nod_Comment #24
nod_looks green enough
Comment #25
alexpottHow green is green enough for a JS patch?
Comment #26
alexpottGiven the low number of usages, the odd functionality and the fact it has been deprecated for ages... Committed c8f4690 and pushed to 8.0.x. Thanks!
Comment #29
nod_Comment #30
cdog commentedWoohoo! We made it! This is my first contribution to Drupal core and I really enjoyed it, thanks everyone! :D