Browse Source

fix testing for undefined

Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
Florian Schunk 5 years ago
parent
commit
332b4aee9d
3 changed files with 3 additions and 10 deletions
  1. 1 1
      apps/files/js/fileactions.js
  2. 1 1
      apps/files/js/filelist.js
  3. 1 8
      core/js/oc-dialogs.js

+ 1 - 1
apps/files/js/fileactions.js

@@ -649,7 +649,7 @@
 						actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE;
 					}
 					var dialogDir = context.dir;
-					if (context.fileList.dirInfo.dirLastCopiedTo != undefined) {
+					if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') {
 						dialogDir = context.fileList.dirInfo.dirLastCopiedTo;
 					}
 					OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {

+ 1 - 1
apps/files/js/filelist.js

@@ -919,7 +919,7 @@
 
 			var actions = this.isSelectedMovable() ? OC.dialogs.FILEPICKER_TYPE_COPY_MOVE : OC.dialogs.FILEPICKER_TYPE_COPY;
 			var dialogDir = self.getCurrentDirectory();
-			if (self.dirInfo.dirLastCopiedTo != undefined) {
+			if (typeof self.dirInfo.dirLastCopiedTo !== 'undefined') {
 				dialogDir = self.dirInfo.dirLastCopiedTo;
 			}
 			OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {

+ 1 - 8
core/js/oc-dialogs.js

@@ -215,9 +215,7 @@ var OCdialogs = {
 		this.filepicker.filesClient = (OCA.Sharing && OCA.Sharing.PublicApp && OCA.Sharing.PublicApp.fileList)? OCA.Sharing.PublicApp.fileList.filesClient: OC.Files.getClient();
 
 		this.filelist = null;
-		if (path == undefined) {
-			path = '';
-		}
+		path = path || '';
 
 		$.when(this._getFilePickerTemplate()).then(function($tmpl) {
 			self.filepicker.loading = false;
@@ -236,14 +234,9 @@ var OCdialogs = {
 			self.$filePicker = $tmpl.octemplate({
 				dialog_name: dialogName,
 				title: title,
-<<<<<<< HEAD
 				emptytext: emptyText,
 				newtext: newText
-			}).data('path', '').data('multiselect', multiselect).data('mimetype', mimetypeFilter);
-=======
-				emptytext: emptyText
 			}).data('path', path).data('multiselect', multiselect).data('mimetype', mimetypeFilter);
->>>>>>> copy Dialog starts in current directory
 
 			if (modal === undefined) {
 				modal = false;