From dfa52b485491140e9284e199a84c328c7f8f60a3 Mon Sep 17 00:00:00 2001
From: Chris Hood <chris@univate.com.au>
Date: Sun, 29 May 2011 14:51:27 +1000
Subject: [PATCH] when using remove button it still attempts to show dynamic preview

---
 imagefield_crop_widget.inc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/imagefield_crop_widget.inc b/imagefield_crop_widget.inc
index 0e5a784..9f9bf03 100644
--- a/imagefield_crop_widget.inc
+++ b/imagefield_crop_widget.inc
@@ -108,6 +108,8 @@ function theme_imagefield_crop_widget($element) {
 }
 
 function imagefield_crop_widget_process($element, $edit, &$form_state, $form) {
+  if (!($element['data']['#access'])) return $element;
+
   static $added_js = array();
 
   $module_path = drupal_get_path('module', 'imagefield_crop');
-- 
1.7.4.1

