Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
8 changes: 5 additions & 3 deletions dist/jquery.printelement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! jQuery printElement - v2.0.1 - 2014-08-22
/*! jQuery printElement - v2.0.1 - 2015-04-15
* https://github.com/erikzaadi/jQuery.printElement
* Copyright (c) 2014 erikzaadi; Licensed MIT, GPL */
* Copyright (c) 2015 erikzaadi; Licensed MIT, GPL */
/*global window,focus,setTimeout,navigator*/
(function (window, undefined) {
var document = window.document;
Expand Down Expand Up @@ -53,7 +53,9 @@
var popupOrIframe = null;
var documentToWriteTo = null;
if (opts.printMode.toLowerCase() === 'popup') {
popupOrIframe = window.open('about:blank', 'printElementWindow', 'width=650,height=440,scrollbars=yes');
// IE duplication name bug: http://stackoverflow.com/questions/7146767/i-get-access-is-denied-when-i-try-to-print-a-page-using-jquery-printelement-js
var windowName = 'printElementWindow_' + (Math.round(Math.random() * 99999)).toString();
popupOrIframe = window.open('about:blank', windowName, 'width=650,height=440,scrollbars=yes');
documentToWriteTo = popupOrIframe.document;
} else {
//The random ID is to overcome a safari bug http://www.cjboco.com.sharedcopy.com/post.cfm/442dc92cd1c0ca10a5c35210b8166882.html
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.printelement.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jquery.printElement",
"name": "jquery.printelement",
"title": "jQuery printElement",
"description": "The best jQuery plugin ever.",
"version": "2.0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/jquery.printelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
var popupOrIframe = null;
var documentToWriteTo = null;
if (opts.printMode.toLowerCase() === 'popup') {
popupOrIframe = window.open('about:blank', 'printElementWindow', 'width=650,height=440,scrollbars=yes');
// IE duplication name bug: http://stackoverflow.com/questions/7146767/i-get-access-is-denied-when-i-try-to-print-a-page-using-jquery-printelement-js
var windowName = 'printElementWindow_' + (Math.round(Math.random() * 99999)).toString();
popupOrIframe = window.open('about:blank', windowName, 'width=650,height=440,scrollbars=yes');
documentToWriteTo = popupOrIframe.document;
} else {
//The random ID is to overcome a safari bug http://www.cjboco.com.sharedcopy.com/post.cfm/442dc92cd1c0ca10a5c35210b8166882.html
Expand Down