Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jQuery.print: increase max string/array lengths, ignore non element d…

…om nodes
  • Loading branch information...
commit f5be1790b3970810a838ca0dbc0347e736b079f5 1 parent 4627630
@tmm1 tmm1 authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/jquery.print.js
View
15 lib/jquery.print.js
@@ -3,7 +3,7 @@
// helper functions
function print_array(obj, opts){
- opts.maxString = 25
+ opts.maxString = 40
var max = obj.length > opts.maxArray ? opts.maxArray : obj.length
var result = [];
@@ -19,14 +19,15 @@
}
function print_element(obj){
- return "<" + obj.tagName.toLowerCase() +
- (obj.className != "" ? " class='" + obj.className + "'" : "") +
- (obj.id != "" ? " id='" + obj.id + "'" : "") +
- ">"
+ if (obj.nodeType == 1)
+ return "<" + obj.tagName.toLowerCase() +
+ (obj.className != "" ? " class='" + obj.className + "'" : "") +
+ (obj.id != "" ? " id='" + obj.id + "'" : "") +
+ ">"
}
function print_object(obj, opts){
- opts.maxString = 25
+ opts.maxString = 40
if (!opts.seen) opts.seen = []
var result = []
@@ -124,7 +125,7 @@
}
$.print.options = {
- maxArray: 6,
+ maxArray: 10,
maxString: 0
}
})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.