Commits

christiansalazar committed ab8eec6

FIX ISSUE #4 - problem with delete action not taken after previous commit

Comments (0)

Files changed (1)

assets/yiifilemanager-fileviewer-widget.js

 			// on success this call will launch the yiifileman_on_action() event
 			_send({ action: action , file_ids: file_ids }, function(ok,resp){
 				opts.onAfterAction(w,action, info, ok, resp);
-				if((ok==true) && (resp === true)){
-					if(action=='select'){
+				if((ok==true) && (resp === true) && (action=='select'))
 						_cancel_method(w); // ok hide the dialog
-					}else
-					if(action=='delete'){
-						// remove the selected files from the view
-						$.each(file_ids,function(i, file_id){
-							var li = _find_item(file_id);				
-							if(li) li.remove();
-						});
-					}
+				if((ok==true) && (action=='delete')){
+					// remove the selected files from the view
+					$.each(file_ids,function(i, file_id){
+						var li = _find_item(file_id);				
+						if(li) li.remove();
+					});
 				}
 			});	
 		}