Skip to content
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

Match 'Print'? #27

Open
wlanni opened this issue May 2, 2014 · 0 comments
Open

Match 'Print'? #27

wlanni opened this issue May 2, 2014 · 0 comments

Comments

@wlanni
Copy link

wlanni commented May 2, 2014

Hey,

Looking at how this functions, I'm not sure that this script is compatible in any way with matching on a print media query, but... before I do my own thing (namely use this code:

var mql = matchMedia('print');
mql.addListener(function(mql) {
    if(mql.matches) {
        console.log('Printed!');
    }
});

I just thought I'd ask if there was some way to get your script to work with a print query.

Essentially, I need to trigger a javascript exporting canvas content to a new image on print, and i'm just trying to keep my code consolidated.

What I've tried so far:

  1. Added this to my scss:
@media print {
html {font-family: 'print';}
body:after {
    content: 'print';
}
}
  1. Added this to my queries array:
 {
    context: 'print',
    match: function(a) {
        console.log("printed");
    }
}

And it didn't work when I hit print.

OK Thanks!

w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant