From b2648a037a18beca383d35c8e5c5c9fe9f8c3b01 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 29 Jan 2009 16:21:11 -0800 Subject: [PATCH] Prevent UI from attempting to load undefined toolbar buttons when viewing the trash. --- static/js/Wiki.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 598d838..e18b972 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -1312,7 +1312,7 @@ Wiki.prototype.connect_image_button = function ( button, filename_prefix ) { Wiki.prototype.down_image_button = function ( name ) { var button = getElement( name ); - if ( !button ) + if ( !button || !button.filename_preifx ) return; var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small ); @@ -1328,7 +1328,7 @@ Wiki.prototype.down_image_button = function ( name ) { Wiki.prototype.up_image_button = function ( name ) { var button = getElement( name ); - if ( !button ) + if ( !button || !button.filename_prefix ) return; var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small ); @@ -1344,7 +1344,7 @@ Wiki.prototype.up_image_button = function ( name ) { Wiki.prototype.toggle_image_button = function ( name ) { var button = getElement( name ); - if ( !button ) + if ( !button || !button.filename_prefix ) return; var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small );