From e61cc619f180ab6ba1a9dfa7fd2c3783224205be Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 17 Feb 2016 16:05:30 +0000 Subject: [PATCH] Remove some lingering inline js --- .../inc/class.importexport_export_ui.inc.php | 9 +------- importexport/js/app.js | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index fc352474a5..488b58023a 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -211,7 +211,6 @@ class importexport_export_ui { $content['filter']['fields'] = importexport_helper_functions::get_filter_fields($_appname, $selected_plugin); if(!$content['filter']['fields']) { - $this->js->set_onload("\$j('input[value=\"filter\"]').parent().hide();"); $content['no_filter'] = true; } else @@ -241,13 +240,7 @@ class importexport_export_ui { $content['selection'] = 'search'; } - // Disable / hide definition filter if not selected - if($content['selection'] != 'filter') - { - $this->js->set_onload(" - \$j('div.filters').hide(); - "); - } + unset ($plugin_object); $apps = importexport_helper_functions::get_apps('export'); //error_log(__METHOD__.__LINE__.array2string($apps)); diff --git a/importexport/js/app.js b/importexport/js/app.js index 27e35b8fc2..2520f08e97 100644 --- a/importexport/js/app.js +++ b/importexport/js/app.js @@ -50,11 +50,24 @@ app.classes.importexport = AppJS.extend( // call parent this._super.apply(this, arguments); - if(this.et2.getWidgetById('export') && !this.et2.getArrayMgr("content").getEntry("definition")) + if(this.et2.getWidgetById('export')) { - // et2 doesn't understand a disabled button in the normal sense - $j(this.et2.getWidgetById('export').getDOMNode()).attr('disabled','disabled'); - $j(this.et2.getWidgetById('preview').getDOMNode()).attr('disabled','disabled'); + if(!this.et2.getArrayMgr("content").getEntry("definition")) + { + // et2 doesn't understand a disabled button in the normal sense + $j(this.et2.getWidgetById('export').getDOMNode()).attr('disabled','disabled'); + $j(this.et2.getWidgetById('preview').getDOMNode()).attr('disabled','disabled'); + } + if(!this.et2.getArrayMgr("content").getEntry("filter")) + { + $j('input[value="filter"]').parent().hide(); + } + + // Disable / hide definition filter if not selected + if(this.et2.getArrayMgr("content").getEntry("selection") != 'filter') + { + $j('div.filters').hide(); + } } },