Fix some bugs in printing:

- Framework was iterating over all app tabs, not just the current one
- Skip hidden etemplate widgets
This commit is contained in:
nathangray 2017-10-10 10:15:24 -06:00
parent 2ff84d5254
commit 82dd2cbc11
2 changed files with 5 additions and 1 deletions

View File

@ -995,6 +995,10 @@ etemplate2.prototype.print = function()
this.widgetContainer.iterateOver(function(_widget) {
// Skip widgets from a different etemplate (home)
if(_widget.getInstanceManager() != this) return;
// Skip hidden widgets
if(jQuery(_widget.getDOMNode()).filter(':visible').length === 0) return;
var result = _widget.beforePrint();
if (typeof result == "object" && result.done)
{

View File

@ -1000,7 +1000,7 @@ var fw_base = (function(){ "use strict"; return Class.extend(
// et2 available, let its widgets prepare
var deferred = [];
var et2_list = [];
jQuery('.et2_container',this.activeApp.tab.contDiv).each(function() {
jQuery('.et2_container',this.activeApp.tab.contentDiv).each(function() {
var et2 = etemplate2.getById(this.id);
if(et2 && jQuery(et2.DOMContainer).filter(':visible').length)
{