Closed (fixed)
Project:
Omega
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2013 at 23:41 UTC
Updated:
31 Aug 2015 at 02:13 UTC
Jump to comment: Most recent
I've been using and loving the .bind('responsivelayout') in omega 3 but not sure how to accomplish the same thing in omega 4. I know the breakpoints are not hard coded anymore in Omega, maybe this would be a nice feature for the Breakpoints module?
Info on using this in Omega 3 here: #1478648: Respond in your own javascript file on the responsive-layout classes
Comments
Comment #1
fubhy commentedYes, this is still possible (with some other syntax and some extra work). Will tell you how it works tomorrow (currently writing from my phone). i improved this quite a bit for 4.x. It's faster and more flexible now. Will get back to you tomorrow.
Comment #2
swim commentedWould love some clarification on this as well. RE: my comment , I feel I'm doing this wrong / not in line with Omega.
Comment #3
fubhy commentedSorry, was too busy yesterday to work on the issue queue... Here is the promised answer:
I assume that you are using Omega 4.x-dev (latest, as stated in the *version* dropdown in this issue).
Due to #2036299: Remove third party libraries from repository we had to remove all external libraries from Omega 4.x core. It now lies in the responsibilty of each theme to download and place them in the right spot.
Before we can start, we have to download the matchMedia polyfill: https://github.com/paulirish/matchMedia.js/
Simply download
matchMedia.jsandmatchMedia.addListener.jstoYOURTHEME/js.Now that we have the polyfill in place we can already use custom JS code to match media queries or add listeners. However, it sounds like you just want a simple solution to provide media-query classes. For that, you have to do this:
Create a
YOURTHEME_preprocess_html()inYOURTHEME/preprocess/html.preprocess.incand write the following code there:Comment #5
teedave commentedI know this is an old post, but I would guess alot of people are viewing this still.
in case you copied/pasted this and wondered why it doesn't work, "options" should be "$options" in all 3 drupal_add_js functions, not just the first :)