Skip to content

Commit

Permalink
fix warning when wpWidgets is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclause committed Jun 13, 2016
1 parent 5890ce3 commit ae00f19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions admin/js/widgets-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/
jQuery(document).ready(
function($){
//if(typeof wpWidgets === 'undefined') return;
if(!window.wpWidgets) return;

var qtx = qTranslateConfig.js.get_qtx();

var onWidgetUpdate = function( evt, widget ){
Expand All @@ -11,10 +14,8 @@ function($){
widget.find("textarea[id^='widget-text-'][id$='-text']").each(function(i,e){qtx.refreshContentHook(e);});
}

if(wpWidgets){
$( document ).on( 'widget-added', onWidgetUpdate );
$( document ).on( 'widget-updated', onWidgetUpdate );
}
$( document ).on( 'widget-added', onWidgetUpdate );
$( document ).on( 'widget-updated', onWidgetUpdate );

var onLanguageSwitchAfter = function(){
jQuery('#widgets-right .widget').each(function(){ wpWidgets.appendTitle(this); });
Expand Down
2 changes: 1 addition & 1 deletion admin/js/widgets-exec.min.js

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

0 comments on commit ae00f19

Please sign in to comment.