Browse Source

HUE-461. Clicking the Save As button in the file editor causes all changes to be thrown away.

Andrew Yao 14 years ago
parent
commit
3e260cd150

+ 4 - 2
apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileBrowser.js

@@ -195,7 +195,8 @@ ART.Sheet.define('window.filechooser.browser', {
 					}
 					}
 				});
 				});
 			} else {
 			} else {
-				$(this).getElement('.fb-upload').set('target', '_blank');
+				var uploader = $(this).getElement('.fb-upload');
+				if (uploader) uploader.set('target', '_blank');
 			}
 			}
 		},
 		},
 
 
@@ -215,7 +216,8 @@ ART.Sheet.define('window.filechooser.browser', {
 				//note we have a very short delay here; the DOM needs a moment to be there or else you sometimes
 				//note we have a very short delay here; the DOM needs a moment to be there or else you sometimes
 				//get the error "obj.CallFunction is not a function" which means that the JS can't communicate with
 				//get the error "obj.CallFunction is not a function" which means that the JS can't communicate with
 				//the swf file
 				//the swf file
-				this.makeUploader($(this).getElement('.fb-upload').get('href').toURI().get('data').dest);
+				var uploader = $(this).getElement('.fb-upload');
+				if (uploader) this.makeUploader(uploader.get('href').toURI().get('data').dest);
 			}).delay(10, this);
 			}).delay(10, this);
 
 
 		},
 		},

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/edit.mako

@@ -40,7 +40,7 @@
     % endfor
     % endfor
   </div>
   </div>
 % endif
 % endif
-<form class="fe-editForm" method="post" action="${url('filebrowser.views.save_file')}">
+<form class="fe-editForm noReset" method="post" action="${url('filebrowser.views.save_file')}">
     ${edit.render_field(form["path"], hidden=True, notitle=True)}
     ${edit.render_field(form["path"], hidden=True, notitle=True)}
     ${edit.render_field(form["encoding"], hidden=True, notitle=True)}
     ${edit.render_field(form["encoding"], hidden=True, notitle=True)}
     <h2 class="jframe-hidden">${form["contents"].label_tag() | n}</h2>
     <h2 class="jframe-hidden">${form["contents"].label_tag() | n}</h2>

+ 1 - 1
ext/thirdparty/js/jframe.hash

@@ -1 +1 @@
-378926e665ee49b8f2c416ad14f96e64e9914d1d
+a2668660a6e0363d94661e010468ee59f467eb0d